fix(edit) if patch fail - save all

This commit is contained in:
coderaiser 2013-07-18 16:23:11 +00:00
parent f3ed6e5d41
commit f9a8e4bb4d
2 changed files with 12 additions and 4 deletions

View file

@ -116,12 +116,13 @@ var CloudCmd, Util, DOM, CloudFunc;
});
};
this.save = function(pUrl, pData, pCallBack, pQuery){
this.save = function(pUrl, pData, pQuery, pCallBack, pError){
sendRequest({
method : 'PUT',
url : CloudFunc.FS + pUrl + (pQuery || ''),
data : pData,
callback : pCallBack,
error : pError,
imgPosition : { top: true }
});
};
@ -174,11 +175,15 @@ var CloudCmd, Util, DOM, CloudFunc;
method : p.method,
url : p.url,
data : lData,
error : Images.showError,
success : function(pData){
success : function(pData) {
Images.hideLoad();
Util.log(pData);
Util.exec(p.callback, pData);
},
error : function(pData) {
Images.showError();
Util.log(pData);
Util.exec(p.error, pData);
}
});
});

View file

@ -94,7 +94,10 @@ var CloudCmd, Util, DOM, JsDiff, ace;
Value = lValue;
DOM.setCurrentSize( lLength, lCurrent );
DOM.RESTfull.save( lPath, lData, null, lPatch);
DOM.RESTfull.save( lPath, lData, lPatch, null, function (){
if (lPatch)
DOM.RESTfull.save( lPath, lValue);
});
});
}
});