Some ajax loading callback.
This commit is contained in:
parent
b3c64ecb85
commit
8141c06fa5
1 changed files with 14 additions and 0 deletions
|
@ -66,6 +66,20 @@ $(function() {
|
|||
$.getScript($(this).attr('href'));
|
||||
return false;
|
||||
});
|
||||
|
||||
// Show and hide loader on ajax callbacks
|
||||
$('*[data-remote]').bind('ajax:beforeSend', function() {
|
||||
$('#loader').show();
|
||||
});
|
||||
|
||||
$('*[data-remote]').bind('ajax:complete', function() {
|
||||
$('#loader').hide();
|
||||
});
|
||||
|
||||
// Disable submit button on ajax forms
|
||||
$('form[data-remote]').bind('ajax:beforeSend', function() {
|
||||
$(this).children('input[type="submit"]').attr('disabled', 'disabled');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue