mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
fix(dom) renameCurrent: if name ".." show dialog -> alert
This commit is contained in:
parent
ba06cf0ff1
commit
8e5862085e
1 changed files with 21 additions and 16 deletions
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue