From 9f78bff377913c2bbcb95fe8909dfab39b3e66da Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 27 Aug 2014 09:33:15 -0400 Subject: [PATCH] refactor(buffer) add COPY, MOVE --- lib/client/buffer.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/client/buffer.js b/lib/client/buffer.js index a2bc1726..3de9ad67 100644 --- a/lib/client/buffer.js +++ b/lib/client/buffer.js @@ -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); }); }; }