feature(dom) getCurrentData: if data from storage do not save it

This commit is contained in:
coderaiser 2013-11-21 08:31:57 +00:00
parent 4a3ccac73c
commit 92ff4b614e

View file

@ -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);
});
};