mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
refactor(buffer) paste
This commit is contained in:
parent
140efc2a78
commit
1bcd27db77
1 changed files with 6 additions and 13 deletions
|
|
@ -114,7 +114,9 @@
|
|||
cut = Storage.get.bind(Storage, CUT);
|
||||
|
||||
Util.exec.parallel([copy, cut], function(error, cp, ct) {
|
||||
var data = {},
|
||||
var opStr = cp ? 'copy' : 'move',
|
||||
opData = cp || ct,
|
||||
data = {},
|
||||
Operation = CloudCmd.Operation,
|
||||
msg = 'Path is same!',
|
||||
path = Info.dirPath;
|
||||
|
|
@ -124,23 +126,14 @@
|
|||
|
||||
if (error) {
|
||||
DOM.Dialog.alert(error);
|
||||
} else if (cp) {
|
||||
data = json.parse(cp);
|
||||
} else {
|
||||
data = json.parse(opData);
|
||||
data.to = path;
|
||||
|
||||
if (data.from === path)
|
||||
Dialog.alert(msg);
|
||||
else
|
||||
Operation.show('copy', data);
|
||||
|
||||
} else if (ct) {
|
||||
data = json.parse(ct);
|
||||
data.to = path;
|
||||
|
||||
if (data.from === path)
|
||||
Dialog.alert(msg);
|
||||
else
|
||||
Operation.show('move', data);
|
||||
Operation.show(opStr, data);
|
||||
}
|
||||
|
||||
clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue