mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00: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(){
|
$('#Form_ManagedModelsSelect').submit(function(){
|
||||||
className = $('select option:selected', this).val();
|
className = $('select option:selected', this).val();
|
||||||
requestPath = $(this).attr('action').replace('ManagedModelsSelect', className + '/add');
|
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();
|
$('#form_actions_right').remove();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@ -218,8 +226,9 @@ $(document).ready(function() {
|
|||||||
* Load a detail editing form into the main edit panel
|
* 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
|
* @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) {
|
$('#right #ModelAdminPanel').load(url, standardStatusHandler(function(result) {
|
||||||
|
if(typeof(successCallback) == 'function') successCallback.apply();
|
||||||
Behaviour.apply(); // refreshes ComplexTableField
|
Behaviour.apply(); // refreshes ComplexTableField
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user