PluginProbe ʕ •ᴥ•ʔ
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More / trunk
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More vtrunk
4.1.0 4.0.9 4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 trunk 1.0.0 2.0.0 2.0.1 2.0.2 2.0.3 3.0 3.0.1 3.0.2 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.2.0 3.2.1 3.2.2 3.2.4 3.2.5 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.4.5 3.4.6 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1
superb-blocks / assets / js / dynamic-blocks / popup.js
superb-blocks / assets / js / dynamic-blocks Last commit date
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()}}))}))})();