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

Expose a method to close the lightbox.

parent ca8671d8
No related merge requests found
......@@ -55,6 +55,9 @@ VuFind.register('lightbox', function Lightbox() {
_modalBody.find('h2:first-of-type')
.after('<div class="flash-message alert alert-' + type + '">' + message + '</div>');
}
function close() {
_modal.modal('hide');
}
/**
* Update content
......@@ -80,7 +83,7 @@ VuFind.register('lightbox', function Lightbox() {
var href = alerts.find('.download').attr('href');
if (typeof href !== 'undefined') {
location.href = href;
_modal.modal('hide');
close();
} else {
showAlert(msgs, 'success');
}
......@@ -386,6 +389,7 @@ VuFind.register('lightbox', function Lightbox() {
ajax: ajax,
alert: showAlert,
bind: bind,
close: close,
flashMessage: flashMessage,
reload: reload,
render: render,
......
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