diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/js/forms.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/static/js/forms.ts b/static/js/forms.ts index 24c3d09..3b1aedc 100644 --- a/static/js/forms.ts +++ b/static/js/forms.ts @@ -49,11 +49,13 @@ }); }); - self.addEventListener("storage", function () { - let stylesheet = document.querySelector('link[href$="default-simple.css"]') + ["storage", "DOMContentLoaded"].forEach(function (event) { + self.addEventListener(event, function () { + let stylesheet = document.querySelector('link[href$="default-simple.css"]') - if (localStorage["config.density.low"] === "on") stylesheet.rel = "stylesheet" - if (localStorage["config.density.high"] === "on") stylesheet.rel = "alternate stylesheet" - }); + if (localStorage["config.density.low"] === "on") stylesheet.rel = "stylesheet" + if (localStorage["config.density.high"] === "on") stylesheet.rel = "alternate stylesheet" + }); + }); })(); |