Skip to content
Snippets Groups Projects
Commit b0410d7b authored by Gregor Gawol's avatar Gregor Gawol
Browse files

refs #20714 [fid_adlr] BARF focus after closed lightbox

parent 82a92226
No related merge requests found
......@@ -8,7 +8,7 @@ VuFind.register('lightbox', function Lightbox() {
var refreshOnClose = false;
var _modalParams = {};
// Elements
var _modal, _modalBody, _clickedButton = null;
var _modal, _modalBody, _clickedButton, _origin = null;
// Utilities
function _storeClickedStatus() {
_clickedButton = this;
......@@ -258,6 +258,8 @@ VuFind.register('lightbox', function Lightbox() {
_lightboxTitle = $(this).data('lightboxTitle') || '';
_modalParams = $(this).data();
VuFind.modal('show');
// Copied finc #17984
_origin = $(this);
ajax(obj);
_currentUrl = this.href;
return false;
......@@ -411,6 +413,11 @@ VuFind.register('lightbox', function Lightbox() {
_modal.on('hidden.bs.modal', function lightboxHidden() {
VuFind.lightbox.reset();
_emit('VuFind.lightbox.closed');
// copied from finc #17984
// set focus back on launching element
if (_origin !== null && _origin !== 'undefined') {
_origin.focus();
}
});
VuFind.modal = function modalShortcut(cmd) {
......
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