fix(edit) save if patch fail

This commit is contained in:
coderaiser 2013-07-18 16:36:54 +00:00
parent 0302ed982b
commit 246749ed66
2 changed files with 4 additions and 8 deletions

View file

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

View file

@ -94,8 +94,8 @@ var CloudCmd, Util, DOM, JsDiff, ace;
Value = lValue;
DOM.setCurrentSize( lLength, lCurrent );
DOM.RESTfull.save( lPath, lData, lPatch, null, function (){
if (lPatch)
DOM.RESTfull.save( lPath, lData, lPatch, function (pData){
if (pData === 'patch : fail. trying to save...')
DOM.RESTfull.save( lPath, lValue);
});
});