From 98bcbdb7e84a7a9d523f29f1e6cc82c6da23903d Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 29 Nov 2013 08:58:48 +0000 Subject: [PATCH] feature(edit) if storage disabled - hash not getted --- lib/client/edit.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/client/edit.js b/lib/client/edit.js index 6d82316a..e4951dca 100644 --- a/lib/client/edit.js +++ b/lib/client/edit.js @@ -156,6 +156,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch; Util.ifExec(!isDiff, function(patch) { var query, + isAllowed = DOM.Storage.isAllowed(), isString = Util.isString(patch), lessLength = patch.length < lValue.length; @@ -166,13 +167,18 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch; query = '?patch'; } - DOM.checkStorageHash(lPath, function(error, equal) { - if (!error) { - if (!equal) - query = ''; - + + Util.ifExec(!isAllowed, function() { DOM.RESTful.save(lPath, lValue, onSave, query); - } + }, function(callback) { + DOM.checkStorageHash(lPath, function(error, equal) { + if (!error) { + if (!equal) + query = ''; + + callback(); + } + }); }); }, function(callback) {