fix(directory) upload files with help of dragndrop when root directory is empty (#145)

This commit is contained in:
coderaiser 2018-02-19 11:03:31 +02:00
parent 06e55831f1
commit ed2cbfed65

View file

@ -1,5 +1,4 @@
/* global CloudCmd */
/* global DOM */
'use strict';
@ -7,9 +6,13 @@ const philip = require('philip');
const Images = require('./images');
const {FS} = require('../../common/cloudfunc');
const DOM = require('.');
const {
getCurrentDirPath: getPathWhenRootEmpty,
} = DOM;
module.exports = (items) => {
const Info = DOM.CurrentInfo;
const Dialog = DOM.Dialog;
if (items.length)
@ -19,7 +22,8 @@ module.exports = (items) => {
return item.webkitGetAsEntry();
});
const path = Info.dirPath
const dirPath = getPathWhenRootEmpty();
const path = dirPath
.replace(/\/$/, '');
const uploader = philip(entries, (type, name, data, i, n, callback) => {