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

Small improvements to lightbox.js

- Error messages now included in pop up.
- Pass form element to data-lightbox-onclose callback.
parent 352bf49e
No related merge requests found
......@@ -164,8 +164,8 @@ VuFind.register('lightbox', function Lightbox() {
}
_update(content);
})
.fail(function lbAjaxFail() {
showAlert(VuFind.translate('error_occurred'), 'danger');
.fail(function lbAjaxFail(deferred, errorType, msg) {
showAlert(VuFind.translate('error_occurred') + '<br/>' + msg, 'danger');
});
return _xhr;
}
......@@ -255,7 +255,7 @@ VuFind.register('lightbox', function Lightbox() {
if ('string' === typeof $(form).data('lightboxOnclose')) {
document.addEventListener('VuFind.lightbox.closed', function lightboxClosed(e) {
this.removeEventListener('VuFind.lightbox.closed', arguments.callee);
_evalCallback($(form).data('lightboxOnclose'), e);
_evalCallback($(form).data('lightboxOnclose'), e, form);
}, false);
}
// Loading
......
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