| Server IP : 69.72.244.102 / Your IP : 216.73.216.164 Web Server : LiteSpeed System : Linux s3434.fra1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64 User : konzalta ( 1271) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/konzalta/atlasoceanlink.com/wp-content/plugins/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");
};