From ead9d2775e1ec1d22756aa9a5d1a6417b767ddce Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 4 Dec 2013 13:52:31 +0000 Subject: [PATCH] fix(dom) getCurrentData: add isCurrentIsDir --- lib/client/dom.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index 6494cfa6..40261a7a 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -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); + }); }); - }); };