mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(buffer) add COPY, MOVE
This commit is contained in:
parent
b2faf20569
commit
9f78bff377
1 changed files with 12 additions and 9 deletions
|
|
@ -8,7 +8,10 @@ var Util, DOM;
|
|||
function BufferProto() {
|
||||
var Storage = DOM.Storage,
|
||||
Dialog = DOM.Dialog,
|
||||
Info = DOM.CurrentInfo;
|
||||
Info = DOM.CurrentInfo,
|
||||
|
||||
COPY = 'copy',
|
||||
MOVE = 'move';
|
||||
|
||||
function getNames() {
|
||||
var name = Info.name,
|
||||
|
|
@ -23,8 +26,8 @@ var Util, DOM;
|
|||
names = getNames(),
|
||||
from = Info.dirPath;
|
||||
|
||||
Storage.remove('move')
|
||||
.set('copy', {
|
||||
Storage.remove(MOVE)
|
||||
.set(COPY, {
|
||||
from : from,
|
||||
names: names
|
||||
});
|
||||
|
|
@ -35,16 +38,16 @@ var Util, DOM;
|
|||
names = getNames(),
|
||||
from = Info.dirPath;
|
||||
|
||||
Storage.remove('copy')
|
||||
.set('move', {
|
||||
Storage.remove(COPY)
|
||||
.set(MOVE, {
|
||||
from : from,
|
||||
names: names
|
||||
});
|
||||
};
|
||||
|
||||
this.paste = function() {
|
||||
var copy = Storage.get.bind(Storage, 'copy'),
|
||||
move = Storage.get.bind(Storage, 'move');
|
||||
var copy = Storage.get.bind(Storage, COPY),
|
||||
move = Storage.get.bind(Storage, MOVE);
|
||||
|
||||
Util.exec.parallel([copy, move], function(error, cp, mv) {
|
||||
var data = {},
|
||||
|
|
@ -75,8 +78,8 @@ var Util, DOM;
|
|||
DOM.moveFiles(data);
|
||||
}
|
||||
|
||||
Storage.remove('copy')
|
||||
.remove('move');
|
||||
Storage.remove(COPY)
|
||||
.remove(MOVE);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue