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

Lightbox callbacks on close as well as form submission.

parent d9c1d56c
No related merge requests found
...@@ -20,15 +20,13 @@ function changeModalContent(html) { ...@@ -20,15 +20,13 @@ function changeModalContent(html) {
$('#modal .modal-body').html(html).modal({'show':true,'backdrop':false}); $('#modal .modal-body').html(html).modal({'show':true,'backdrop':false});
} }
// Close the lightbox and run update functions // Close the lightbox and run update functions
var closeAction = false;
function closeLightbox() { function closeLightbox() {
if(closeAction !== false) {
closeAction();
}
$('#modal').modal('hide'); $('#modal').modal('hide');
} }
function closeLightboxActions() { function closeLightboxActions() {
lightboxShown = false; lightboxShown = false;
// Clean out stack
while(f = callbackStack.pop()) f();
if(modalXHR) { if(modalXHR) {
modalXHR.abort(); modalXHR.abort();
} }
...@@ -37,7 +35,7 @@ function closeLightboxActions() { ...@@ -37,7 +35,7 @@ function closeLightboxActions() {
$('#modal').find('.modal-header h3').html(''); $('#modal').find('.modal-header h3').html('');
$('#modal').find('.modal-body').html(vufindString.loading + "..."); $('#modal').find('.modal-body').html(vufindString.loading + "...");
// Perform checks to update the page // Perform checks to update the page
if(checkSaveStatuses) { if(typeof checkSaveStatuses === 'function') {
checkSaveStatuses(); checkSaveStatuses();
} }
// Record updates // Record updates
...@@ -281,7 +279,7 @@ function ajaxLogin(form) { ...@@ -281,7 +279,7 @@ function ajaxLogin(form) {
// If summon, queue reload // If summon, queue reload
$('.hiddenSource').each(function(i, e) { $('.hiddenSource').each(function(i, e) {
if(e.value == 'Summon') { if(e.value == 'Summon') {
closeAction = function(){document.location.reload(true);}; callbackStack.unshift(function(){alert('!');document.location.reload(true);});
} }
}); });
getLightboxByUrl(lastLightboxURL, lastLightboxPOST); getLightboxByUrl(lastLightboxURL, lastLightboxPOST);
......
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