From ab75e9bba1ab2303a7de113a606469ff54f0fd0e Mon Sep 17 00:00:00 2001 From: Ere Maijala <ere.maijala@helsinki.fi> Date: Tue, 3 Jan 2017 22:06:35 +0200 Subject: [PATCH] Fix lightbox error caused by missing href (#875) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed an error caused by lightbox when checking for href in attributes in _constrainLink and the a element doesn’t have a href (e.g. the confirmation links in the â€Empty Book Bag†button). --- themes/bootstrap3/js/lightbox.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js index 018b171d27b..ca4019a59a5 100644 --- a/themes/bootstrap3/js/lightbox.js +++ b/themes/bootstrap3/js/lightbox.js @@ -190,7 +190,9 @@ VuFind.register('lightbox', function Lightbox() { * data-lightbox-title = Lightbox title (overrides any title the page provides) */ _constrainLink = function constrainLink(event) { - if (typeof $(this).data('lightboxIgnore') != 'undefined' || this.attributes.href.value.charAt(0) === '#') { + if (typeof $(this).data('lightboxIgnore') != 'undefined' + || typeof this.attributes.href === 'undefined' || this.attributes.href.value.charAt(0) === '#' + ) { return true; } if (this.href.length > 1) { -- GitLab