diff --git a/lib/client/dom.js b/lib/client/dom.js index e8339cf9..177cb506 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1511,25 +1511,30 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; if (!Cmd.isCurrentFile(current)) current = Cmd.getCurrentFile(); - from = Cmd.getCurrentName(current), - to = Dialog.prompt('Rename', from) || from, - dirPath = Cmd.getCurrentDirPath(); - cmp = Util.strCmp(from, to); + from = Cmd.getCurrentName(current); - if (!cmp) { - files = { - from : dirPath + from, - to : dirPath + to - }; + if (from === '..') { + Dialog.alert('No files selected!'); + } else { + to = Dialog.prompt('Rename', from) || from; + dirPath = Cmd.getCurrentDirPath(); + cmp = Util.strCmp(from, to); - RESTful.mv(files, function() { - var Storage = DOM.Storage, - path = CloudFunc.rmLastSlash(dirPath); + if (!cmp) { + files = { + from : dirPath + from, + to : dirPath + to + }; - DOM.setCurrentName(to, current); - Cmd.updateCurrentInfo(); - Storage.remove(path); - }); + RESTful.mv(files, function() { + var Storage = DOM.Storage, + path = CloudFunc.rmLastSlash(dirPath); + + DOM.setCurrentName(to, current); + Cmd.updateCurrentInfo(); + Storage.remove(path); + }); + } } };