fix(dom) getCurrentData: add isCurrentIsDir

This commit is contained in:
coderaiser 2013-12-04 13:52:31 +00:00
parent 3e83bc7912
commit ead9d2775e

View file

@ -1490,7 +1490,8 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
var lParams,
lHash,
lCurrentFile = pCurrentFile ? pCurrentFile : this.getCurrentFile(),
lPath = DOM.getCurrentPath(lCurrentFile),
lPath = DOM.getCurrentPath(lCurrentFile),
isDir = DOM.isCurrentIsDir(lCurrentFile),
lFunc = function(pData) {
var lExt = '.json',
@ -1521,14 +1522,17 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
};
DOM.checkStorageHash(lPath, function(error, equal, hash) {
Util.ifExec(!error && equal, function() {
DOM.getDataFromStorage(lPath, lFunc);
}, function() {
lHash = hash;
DOM.getCurrentFileContent(lParams, lCurrentFile);
if (isDir)
DOM.getCurrentFileContent(lParams, lCurrentFile);
else
DOM.checkStorageHash(lPath, function(error, equal, hash) {
Util.ifExec(!error && equal, function() {
DOM.getDataFromStorage(lPath, lFunc);
}, function() {
lHash = hash;
DOM.getCurrentFileContent(lParams, lCurrentFile);
});
});
});
};