From 4aa35291317f7f2eb6c61551314882316677cbca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Mon, 29 Jul 2013 08:23:33 +0200 Subject: [PATCH] Properly close the lightbox when clicking on a link in it. Fix a bug reported by le_ on MobileRead (http://www.mobileread.com/forums/showpost.php?p=2580757&postcount=525) --- util.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util.js b/util.js index 4127e61..3a0a717 100644 --- a/util.js +++ b/util.js @@ -309,6 +309,11 @@ function link_Clicked (event) { event.preventDefault(); var url = currentLink.attr('href'); + if ($(".mfp-ready").length) + { + $.magnificPopup.close(); + } + // The bookdetail / about should be displayed in a lightbox if (getCurrentOption ("use_fancyapps") === "1" && (currentLink.hasClass ("fancydetail") || currentLink.hasClass ("fancyabout"))) {