From a63b95efe0679d81f5ece57e2f808ee6f8650816 Mon Sep 17 00:00:00 2001 From: Ben Ritner Date: Mon, 1 Jul 2024 08:22:02 -0600 Subject: [PATCH] remove outdated --- includes/assets/js/kt-accordion.min.js | 2 +- src/assets/js/kt-accordion.js | 23 ++--------------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/includes/assets/js/kt-accordion.min.js b/includes/assets/js/kt-accordion.min.js index cd3cfb736..0abbdb646 100644 --- a/includes/assets/js/kt-accordion.min.js +++ b/includes/assets/js/kt-accordion.min.js @@ -1 +1 @@ -(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.KadenceAccordion=b()})(this,function(){"use strict";function a(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function b(a,b){for(let c=0;c=c)return;const d=b-a.scrollTop;setTimeout(function(){a.scrollTop+=10*(d/c);a.scrollTop===b||scrollTo(a,b,c-10)},10)},anchor(b){if(""!=window.location.hash){const c=location.hash.substring(1);if(!/^[A-z0-9_-]+$/.test(c))return;if(b.type&&"initialized"===b.type&&a)return;a=!0;const d=document.getElementById(c);if(d&&d.classList.contains("wp-block-kadence-pane")){const a=document.querySelectorAll("[id=\""+c+"\"] .kt-blocks-accordion-header")[0];a.classList.contains("kt-accordion-panel-active")||(b.type&&"initialized"===b.type?window.setTimeout(function(){a.dispatchEvent(new Event("startOpen"))},50):a.dispatchEvent(new Event("startOpen")))}}},init(){const a=document.querySelectorAll(".kt-accordion-inner-wrap"),c=Array.from(a);for(let a=0,b=c.length;a{window.KadenceBlocksAccordion.init()})}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",window.KadenceBlocksAccordion.init):window.KadenceBlocksAccordion.init()}(); \ No newline at end of file +(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.KadenceAccordion=b()})(this,function(){"use strict";function a(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function b(a,b){for(let c=0;c=c)return;const d=b-a.scrollTop;setTimeout(function(){a.scrollTop+=10*(d/c);a.scrollTop===b||scrollTo(a,b,c-10)},10)},anchor(b){if(""!=window.location.hash){const c=location.hash.substring(1);if(!/^[A-z0-9_-]+$/.test(c))return;if(b.type&&"initialized"===b.type&&a)return;a=!0;const d=document.getElementById(c);if(d&&d.classList.contains("wp-block-kadence-pane")){const a=document.querySelectorAll("[id=\""+c+"\"] .kt-blocks-accordion-header")[0];a.classList.contains("kt-accordion-panel-active")||(b.type&&"initialized"===b.type?window.setTimeout(function(){a.dispatchEvent(new Event("startOpen"))},50):a.dispatchEvent(new Event("startOpen")))}}},init(){const a=document.querySelectorAll(".kt-accordion-inner-wrap"),c=Array.from(a);for(let a=0,b=c.length;a{window.KadenceBlocksAccordion.init()})}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",window.KadenceBlocksAccordion.init):window.KadenceBlocksAccordion.init()}(); \ No newline at end of file diff --git a/src/assets/js/kt-accordion.js b/src/assets/js/kt-accordion.js index 921ee4083..3034802eb 100644 --- a/src/assets/js/kt-accordion.js +++ b/src/assets/js/kt-accordion.js @@ -12,20 +12,6 @@ throw new TypeError('Cannot call a class as a function'); } } - (function () { - if (typeof window.CustomEvent === 'function') return false; - - function CustomEvent(event, params) { - params = params || { bubbles: false, cancelable: false, detail: undefined }; - const evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); - return evt; - } - - CustomEvent.prototype = window.Event.prototype; - - window.CustomEvent = CustomEvent; - })(); function _defineProperties(target, props) { for (let i = 0; i < props.length; i++) { @@ -454,10 +440,7 @@ value: function _finishInitialization() { this.container.classList.add(this.settings.initializedClass); this._setRole('presentation', this.container); - // Create a new event - const event = new CustomEvent('initialized'); - // Dispatch the event - this.container.dispatchEvent(event); + this.container.dispatchEvent(new Event('initialized')); }, /** * ADD LISTENERS @@ -732,9 +715,7 @@ panelToOpen.offsetHeight; _header.classList.add(this.settings.activeClass); // 4. Set aria attrs _header.setAttribute('aria-expanded', true); // 5. Resetting toggling so a new event can be fired - const resizeEvent = window.document.createEvent('UIEvents'); - resizeEvent.initUIEvent('resize', true, false, window, 0); - window.dispatchEvent(resizeEvent); + window.dispatchEvent(new Event('resize')); const _transDuration = 1000 * parseFloat(getComputedStyle(panelToOpen).transitionDuration); setTimeout(function () {