mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
API CHANGE Removed unused ajaxSubmitForm() javascript in LeftAndMain.js, please use LeftAndMain.EditForm.js instead
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92693 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
140fae5d7e
commit
fe82f394f1
@ -312,43 +312,6 @@ function unlockStatusMessage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Submit the given form and evaluate the Ajax response.
|
|
||||||
* Needs to be bound to an object with the following parameters to work:
|
|
||||||
* - form
|
|
||||||
* - action
|
|
||||||
* - verb
|
|
||||||
*
|
|
||||||
* The bound function can then be called, with the arguments passed
|
|
||||||
*/
|
|
||||||
|
|
||||||
function ajaxSubmitForm(automated, callAfter, form, action, verb) {
|
|
||||||
var alreadySaved = false;
|
|
||||||
if($(form).elements.length < 2) alreadySaved = true;
|
|
||||||
|
|
||||||
if(alreadySaved) {
|
|
||||||
if(callAfter) callAfter();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
statusMessage(verb + '...', '', true);
|
|
||||||
|
|
||||||
var success = function(response) {
|
|
||||||
Ajax.Evaluator(response);
|
|
||||||
if(callAfter) callAfter();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(callAfter) success = success.bind({callAfter : callAfter});
|
|
||||||
Ajax.SubmitForm(form, action, {
|
|
||||||
onSuccess : success,
|
|
||||||
onFailure : function(response) {
|
|
||||||
errorMessage('Error ' + verb, response);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Behaviour of the statuts message.
|
* Behaviour of the statuts message.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user