Uname: Linux gra108.truehost.cloud 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
Software: LiteSpeed
PHP version: 8.2.26 [ PHP INFO ] PHP os: Linux
Server Ip: 87.98.244.154
Your Ip: 3.149.247.95
User: pumpbmko (2127) | Group: pumpbmko (2132)
Safe Mode: OFF
Disable Function:
allow_url_fopen, show_source, system, shell_exec, passthru, exec, phpinfo, mail, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apallow_url_fopen,show_source, system, shell_exec, passthru, exec, phpinfo, mail, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, ap

name : utils.ts
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");
};
© 2025 GrazzMean-Shell