diff --git a/lib/client/dom.js b/lib/client/dom.js index 0c442b33..8af34670 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1531,7 +1531,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; * @currentFile */ this.renameCurrent = function(current) { - var from, to, dirPath, files, + var from, to, dirPath, files, isExist, RESTful = DOM.RESTful; if (!Cmd.isCurrentFile(current)) @@ -1543,6 +1543,8 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; Dialog.alert('No files selected!'); } else { to = Dialog.prompt('Rename', from) || from; + isExist = !!DOM.getCurrentByName(to); + dirPath = Cmd.getCurrentDirPath(); if (from !== to) { @@ -1558,6 +1560,9 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; DOM.setCurrentName(to, current); Cmd.updateCurrentInfo(); Storage.remove(path); + + if (isExist) + CloudCmd.refresh(); }); } }