Server IP : 192.158.238.246 / Your IP : 216.73.216.55 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/7779/task/7779/cwd/themes/personalias/functions/kirki/kirki-packages/settings/src/ |
Upload File : |
export const emptyElement = (el: HTMLElement) => { while (el.firstChild) { el.removeChild(el.firstChild); } }; export const getClosest = ( el: HTMLElement, selector: string, depth?: number ): HTMLElement | undefined => { if (el.matches(selector)) { return el; } if (el.tagName === "BODY" || el.tagName === "HTML") { return undefined; } let closest = undefined; depth = depth ? depth : 20; for (let i = 0; i < depth; i++) { const parentNode = el.parentNode as HTMLElement; if ( !parentNode || parentNode.tagName === "BODY" || parentNode.tagName === "HTML" ) { break; } if (parentNode.matches(selector)) { return parentNode; } el = parentNode; } return closest; }; export const startLoading = (button: HTMLButtonElement | HTMLElement) => { button.classList.add("is-loading"); }; export const stopLoading = (button: HTMLButtonElement | HTMLElement) => { button.classList.remove("is-loading"); };