diff --git a/lib/client/dom.js b/lib/client/dom.js index b8e3f69e..221b9496 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -791,8 +791,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; if (isDir) { query = '?dir'; type ='directory'; - } - else + } else type = 'file'; type += ' '; @@ -806,20 +805,18 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; else Dialog.alert('No files selected!'); - if (ret) { - if (current || names) - RESTful.delete(path, names, function() { - var dirPath = CurrentInfo.dirPath, - dir = CloudFunc.rmLastSlash(dirPath); - - if (n > 1) - DOM.deleteSelected(files); - else - DOM.deleteCurrent(current); - - Storage.remove(dir); - }, query); - } + if (ret) + RESTful.delete(path, names, function() { + var dirPath = CurrentInfo.dirPath, + dir = CloudFunc.rmLastSlash(dirPath); + + if (n > 1) + DOM.deleteSelected(files); + else + DOM.deleteCurrent(current); + + Storage.remove(dir); + }, query); return ret; };