From 4b4e3d42f338819e25db2f3844dd15f29366a5df Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 27 Aug 2014 07:14:04 -0400 Subject: [PATCH] refactor(dom) processFiles --- lib/client/dom.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index 895516ef..9d33a458 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1465,9 +1465,12 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; * @param operation */ function processFiles(operation) { - var n, name, from, to, files, cmp, msg, opFunc, - path = CurrentInfo.dirPath, + var n, name, files, cmp, msg, opFunc, RESTful = DOM.RESTful, + + from = CurrentInfo.dirPath, + to = DOM.getNotCurrentDirPath(), + names = Cmd.getSelectedNames(), length = names && names.length; @@ -1487,18 +1490,13 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; name = names[0]; } - n = names.length; - - if (n > 1) + if (length > 1) msg += n + ' file(s)'; else msg += '"' + name + '"'; msg += ' to'; - from = path; - to = DOM.getNotCurrentDirPath(); - if (name === '..') { Dialog.alert('No files selected!'); } else { @@ -1509,8 +1507,8 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; if (!cmp && to) { files = { from : from, - names : names, - to : to + to : to, + names : names }; opFunc(files, function() { @@ -1524,7 +1522,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; DOM.setCurrentFile(dotDot); CloudCmd.refresh(dotDot, panelPassive); - DOM.Storage.remove(path); + DOM.Storage.remove(from); }); } }