Skip to content
Snippets Groups Projects
Commit 07f4f3f6 authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Lightbox: Move button disabling to after handler checking.

parent 5e3a0bb1
No related merge requests found
...@@ -181,10 +181,6 @@ VuFind.lightbox = (function() { ...@@ -181,10 +181,6 @@ VuFind.lightbox = (function() {
if (typeof submit.data('lightbox-ignore') !== 'undefined') { if (typeof submit.data('lightbox-ignore') !== 'undefined') {
return true; return true;
} }
// Prevent multiple submission of submit button in lightbox
if (submit.closest(_modal).length > 0) {
submit.attr('disabled', 'disabled');
}
buttonData.name = submit.attr('name') || 'submit'; buttonData.name = submit.attr('name') || 'submit';
buttonData.value = submit.attr('value') || 1; buttonData.value = submit.attr('value') || 1;
} }
...@@ -209,6 +205,10 @@ VuFind.lightbox = (function() { ...@@ -209,6 +205,10 @@ VuFind.lightbox = (function() {
} }
// Loading // Loading
_modalBody.prepend('<i class="fa fa-spinner fa-spin pull-right"></i>'); _modalBody.prepend('<i class="fa fa-spinner fa-spin pull-right"></i>');
// Prevent multiple submission of submit button in lightbox
if (submit.closest(_modal).length > 0) {
submit.attr('disabled', 'disabled');
}
// Get Lightbox content // Get Lightbox content
ajax({ ajax({
url: form.action || _currentUrl, url: form.action || _currentUrl,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment