From 256a71ed4077993935b45dd5fb650dd5da864914 Mon Sep 17 00:00:00 2001
From: Chris Hallberg <crhallberg@gmail.com>
Date: Wed, 15 Nov 2017 08:56:41 -0500
Subject: [PATCH] Prevent the lightbox from capturing links with unique
 resource identifiers (mailto:, tel:, etc)

---
 themes/bootstrap3/js/lightbox.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js
index 51393a46e4a..06fb8ea4193 100644
--- a/themes/bootstrap3/js/lightbox.js
+++ b/themes/bootstrap3/js/lightbox.js
@@ -219,7 +219,8 @@ VuFind.register('lightbox', function Lightbox() {
    */
   _constrainLink = function constrainLink(event) {
     if (typeof $(this).data('lightboxIgnore') != 'undefined'
-      || typeof this.attributes.href === 'undefined' || this.attributes.href.value.charAt(0) === '#'
+      || typeof this.attributes.href === 'undefined' || this.href.charAt(0) === '#'
+      || this.href.match(/^[a-zA-Z]+\:[^\/]/) // ignore resource identifiers (mailto:, tel:, etc.)
     ) {
       return true;
     }
-- 
GitLab