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

Remove spinners when submit event prevented.

parent fe7c7e79
No related merge requests found
...@@ -338,14 +338,20 @@ var Lightbox = { ...@@ -338,14 +338,20 @@ var Lightbox = {
// Default action, with custom callback // Default action, with custom callback
} else if(typeof Lightbox.formCallbacks[name] !== "undefined") { } else if(typeof Lightbox.formCallbacks[name] !== "undefined") {
$form.submit(function(evt){ $form.submit(function(evt){
if(evt.isDefaultPrevented()) return false; if(evt.isDefaultPrevented()) {
$('.fa.fa-spinner', evt.target).remove();
return false;
}
Lightbox.submit($(evt.target), Lightbox.formCallbacks[name]); Lightbox.submit($(evt.target), Lightbox.formCallbacks[name]);
return false; return false;
}); });
// Default // Default
} else { } else {
$form.unbind('submit').submit(function(evt){ $form.unbind('submit').submit(function(evt){
if(evt.isDefaultPrevented()) return false; if(evt.isDefaultPrevented()) {
$('.fa.fa-spinner', evt.target).remove();
return false;
}
Lightbox.submit($(evt.target), function(html){ Lightbox.submit($(evt.target), function(html){
Lightbox.checkForError(html, Lightbox.close); Lightbox.checkForError(html, Lightbox.close);
}); });
......
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