From ed2cbfed652540f574ddbc03b9de942d71ba34ed Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 19 Feb 2018 11:03:31 +0200 Subject: [PATCH] fix(directory) upload files with help of dragndrop when root directory is empty (#145) --- client/dom/directory.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/dom/directory.js b/client/dom/directory.js index a44dda09..7a58025b 100644 --- a/client/dom/directory.js +++ b/client/dom/directory.js @@ -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) => {