From 92ff4b614ee23e7d9206dc54d1fe8e7e66add4e7 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 21 Nov 2013 08:31:57 +0000 Subject: [PATCH] feature(dom) getCurrentData: if data from storage do not save it --- lib/client/dom.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index 2e017669..f8ebe525 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1472,6 +1472,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; */ this.getCurrentData = function(pCallBack, pCurrentFile) { var lParams, + isFromStorage, lCurrentFile = pCurrentFile ? pCurrentFile : this.getCurrentFile(), lPath = DOM.getCurrentPath(lCurrentFile), @@ -1486,7 +1487,8 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; lName += lExt; } - DOM.saveDataToStorage(lPath, pData); + if (!isFromStorage) + DOM.saveDataToStorage(lPath, pData); Util.exec(pCallBack, { data: pData, @@ -1503,9 +1505,10 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; }; DOM.getDataFromStorage(lPath, function(data) { - if (data) + if (data) { + isFromStorage = true; lFunc(data); - else + } else DOM.getCurrentFileContent(lParams, lCurrentFile); }); };