mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Fixed loading indicator in for add form in ModelAdmin.js
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@63297 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b464952522
commit
bb3adae0bc
@ -195,7 +195,15 @@ $(document).ready(function() {
|
||||
$('#Form_ManagedModelsSelect').submit(function(){
|
||||
className = $('select option:selected', this).val();
|
||||
requestPath = $(this).attr('action').replace('ManagedModelsSelect', className + '/add');
|
||||
$('#ModelAdminPanel').fn('loadForm', requestPath);
|
||||
var $button = $(':submit', this);
|
||||
$('#ModelAdminPanel').fn(
|
||||
'loadForm',
|
||||
requestPath,
|
||||
function() {
|
||||
$button.removeClass('loading');
|
||||
$button = null;
|
||||
}
|
||||
);
|
||||
$('#form_actions_right').remove();
|
||||
return false;
|
||||
});
|
||||
@ -218,8 +226,9 @@ $(document).ready(function() {
|
||||
* Load a detail editing form into the main edit panel
|
||||
* @todo Convert everything to jQuery so that the built-in load method can be used with this instead
|
||||
*/
|
||||
loadForm: function(url) {
|
||||
loadForm: function(url, successCallback) {
|
||||
$('#right #ModelAdminPanel').load(url, standardStatusHandler(function(result) {
|
||||
if(typeof(successCallback) == 'function') successCallback.apply();
|
||||
Behaviour.apply(); // refreshes ComplexTableField
|
||||
}));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user