mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix(dom) renameCurrent: when there is file with same name - two same names is shown on a panel
This commit is contained in:
parent
d82ea49e94
commit
d31345203f
1 changed files with 6 additions and 1 deletions
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue