mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 08:56:20 +00:00
feature(dom) getCurrentData: if data from storage do not save it
This commit is contained in:
parent
4a3ccac73c
commit
92ff4b614e
1 changed files with 6 additions and 3 deletions
|
|
@ -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);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue