accordion.js
2 weeks ago
add-to-cart.js
2 weeks ago
animated-heading.js
2 weeks ago
block-animations.js
2 weeks ago
carousel.js
2 weeks ago
count-animations.js
2 weeks ago
countdown.js
2 weeks ago
form.js
2 weeks ago
popup.js
2 weeks ago
progress-bar.js
2 weeks ago
reveal-button.js
2 weeks ago
sticky.js
2 weeks ago
table-of-contents-smooth-scroll.js
2 weeks ago
typing-animations.js
2 weeks ago
popup.js
1 lines
| 1 | (()=>{"use strict";const e="superb-popup-visible",t="superb-popup-open",n="_superbPopups";window[n]=window[n]||{};var o=0;function r(e){return e.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), [tabindex]:not([tabindex="-1"])')}function u(u){var i=u.getAttribute("data-popup-id");if(i){var a=u.querySelector(".superb-popup-overlay");if(a){var l=a.querySelector(".superb-popup-backdrop"),s=a.querySelector(".superb-popup-dialog"),d=a.querySelector(".superb-popup-close"),p="false"!==u.getAttribute("data-close-overlay"),c="false"!==u.getAttribute("data-close-esc"),f="false"!==u.getAttribute("data-show-overlay"),v=!1,b=null,y=null,g=null;d&&d.addEventListener("click",(function(e){e.preventDefault(),w()})),l&&p&&l.addEventListener("click",(function(){w()})),s.addEventListener("click",(function(e){e.target.closest(".superb-popup-close-action")&&(e.preventDefault(),w())})),a.addEventListener("keydown",(function(e){if("Tab"===e.key&&v&&f){var t=r(s);if(t.length){var n=t[0],o=t[t.length-1];e.shiftKey?document.activeElement===n&&(e.preventDefault(),o.focus()):document.activeElement===o&&(e.preventDefault(),n.focus())}}}));var m={open:L,close:w,closeOnEsc:c,get isOpen(){return v},element:u};if(window[n][i]=m,u._superbPopupOpen=L,u._superbPopupClose=w,Object.defineProperty(u,"_superbPopupIsOpen",{get:function(){return v}}),"true"===u.getAttribute("data-trigger-on-load")){var E=parseInt(u.getAttribute("data-trigger-delay")||"3",10);setTimeout((function(){v||L(null)}),1e3*E)}}}function L(n){if(!v){v=!0,b=n||null,o++,a.style.display="",a.offsetHeight,a.classList.add(e),f&&document.body.classList.add(t);var i="false"!==u.getAttribute("data-close-button")&&d?d:null;if(!i){var l=r(s);i=l.length?l[0]:s}i&&i.focus()}}function w(){v&&(v=!1,o--,a.classList.remove(e),f&&o<=0&&(o=0,document.body.classList.remove(t)),g&&a.removeEventListener("transitionend",g),y&&clearTimeout(y),g=function(){a.removeEventListener("transitionend",g),g=null,y&&(clearTimeout(y),y=null),v||(a.style.display="none")},a.addEventListener("transitionend",g),y=setTimeout((function(){y=null,g&&(a.removeEventListener("transitionend",g),g=null),v||(a.style.display="none")}),400),b&&b.focus&&b.focus(),b=null)}}function i(e){var t=e.getAttribute("data-popup-target");t&&e.addEventListener("click",(function(o){o.preventDefault();var r=window[n][t];r&&r.open(e)}))}document.addEventListener("DOMContentLoaded",(function(){for(var e=document.querySelectorAll(".wp-block-superb-addons-popup"),t=0;t<e.length;t++)u(e[t]);for(var o=document.querySelectorAll("[data-popup-target]"),r=0;r<o.length;r++)i(o[r]);document.addEventListener("keydown",(function(e){if("Escape"===e.key)for(var t=window[n],o=Object.keys(t),r=o.length-1;r>=0;r--){var u=t[o[r]];if(u.isOpen&&u.closeOnEsc)return void u.close()}}))}))})(); |