Remove jQuery ready usage (#23858)

Replace it with equal function of our own and enable the eslint rule to
forbid future usage.
This commit is contained in:
silverwind 2023-04-02 00:40:22 +02:00 committed by GitHub
parent eadda68ded
commit ae36113568
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View file

@ -67,3 +67,11 @@ export function hideElem(el) {
export function toggleElem(el, force) {
elementsCall(el, toggleShown, force);
}
export function onDomReady(cb) {
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', cb);
} else {
cb();
}
}