diff --git a/dist/ratchet.js b/dist/ratchet.js index f7150bb..b2d2c5b 100644 --- a/dist/ratchet.js +++ b/dist/ratchet.js @@ -36,7 +36,7 @@ }(); /* ---------------------------------- - * POPOVER v1.0.0 + * POPOVER v1.0.1 * Licensed under The MIT License * http://opensource.org/licenses/MIT * ---------------------------------- */ @@ -75,16 +75,16 @@ var anchor = findPopovers(e.target); if (!anchor || !anchor.hash) return; - - try{ - popover = document.querySelector(anchor.hash); - } - catch (error) { - popover = null; - } - - if (popover == null) return; - + + try { + popover = document.querySelector(anchor.hash); + } + catch (error) { + popover = null; + } + + if (popover == null) return; + if (!popover || !popover.classList.contains('popover')) return; return popover; diff --git a/lib/js/popovers.js b/lib/js/popovers.js index a208c64..d400c01 100644 --- a/lib/js/popovers.js +++ b/lib/js/popovers.js @@ -1,5 +1,5 @@ /* ---------------------------------- - * POPOVER v1.0.0 + * POPOVER v1.0.1 * Licensed under The MIT License * http://opensource.org/licenses/MIT * ---------------------------------- */ @@ -39,7 +39,14 @@ if (!anchor || !anchor.hash) return; - popover = document.querySelector(anchor.hash); + try { + popover = document.querySelector(anchor.hash); + } + catch (error) { + popover = null; + } + + if (popover == null) return; if (!popover || !popover.classList.contains('popover')) return;