Browse Source

Updated JS to ignore hidden next button when adding the spinner to the form so it does not add two.

pull/563/head
Matthew Perry 10 years ago
parent
commit
b726f2d5b6
  1. 9
      js/spinner.js

9
js/spinner.js

@ -22,9 +22,11 @@
});
for (var base in settings.spinner) {
var id = '#' + base;
// Don't add spinner to the hidden next/ingest button.
if (id != '#edit-hidden-next') {
$(id, context).once('spinner', function () {
var spinner = new Spinner(settings.spinner[base].opts);
$(id).parents('form').one('submit', function(event) {
$(id).parents('form').one('submit', function (event) {
if ($(this).data('clicked').is(id)) {
event.preventDefault();
// Add Message.
@ -39,12 +41,12 @@
if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) {
$(':submit').attr('disabled', 'disabled');
}
setTimeout(function() {
setTimeout(function () {
// Allow for the button to be clicked, then click it then
// prevent the default behavoir.
$(id).removeAttr('disabled')
.click()
.click(function(event) {
.click(function (event) {
event.preventDefault();
});
}, 500);
@ -54,5 +56,6 @@
});
}
}
}
};
})(jQuery);

Loading…
Cancel
Save