From 7f1ef7a019528ea3d4161c0bd28ae347ee727bc7 Mon Sep 17 00:00:00 2001 From: Jon <134811123+jonsmy@users.noreply.github.com> Date: Tue, 20 Feb 2024 20:26:55 +0000 Subject: [PATCH] js/lcn/classes.js: init LCNSite.INSTANCE after dom ready --- js/lcn/classes.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/lcn/classes.js b/js/lcn/classes.js index 2b840f53..65157324 100644 --- a/js/lcn/classes.js +++ b/js/lcn/classes.js @@ -4,7 +4,7 @@ */ globalThis.LCNSite = class LCNSite { - static INSTANCE = new this(); + static INSTANCE = null; #isModerator = document.body.classList.contains("is-moderator"); #isThreadPage = document.body.classList.contains("active-thread"); @@ -264,6 +264,8 @@ globalThis.LCNPostContainer.all = () => Array.prototype.map.apply(document.query globalThis.LCNPostWrapper.all = () => Array.prototype.map.apply(document.querySelectorAll(".post-wrapper"), [ node => LCNPostWrapper.assign(node) ]); $().ready(() => { + LCNSite.INSTANCE = new LCNSite(); + const clazzes = [ LCNPost, LCNThread, LCNPostContainer, LCNPostWrapper ] for (const clazz of clazzes) { clazz.forEach = fn => clazz.all().forEach(fn)