diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2022-12-24 15:26:51 +0100 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2022-12-24 15:39:40 +0100 |
commit | 00094c25c551d7990658228c61726d7d50b3c4fd (patch) | |
tree | d5cd85bd52769dd3f4ca661d575a7a2c79e78e5a /assets/js/theme-switcher.js | |
parent | 6622be235286747f787001e56dd483e79f319190 (diff) |
Activate theme switcher as soon as the body tag exists.
Diffstat (limited to 'assets/js/theme-switcher.js')
-rw-r--r-- | assets/js/theme-switcher.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/assets/js/theme-switcher.js b/assets/js/theme-switcher.js index 0cca832..f2e58f6 100644 --- a/assets/js/theme-switcher.js +++ b/assets/js/theme-switcher.js @@ -91,11 +91,9 @@ const themeSwitcher = { }, }; -window.addEventListener('load', function () { - themeSwitcher.addButton({ - tag: 'BUTTON', - class: 'contrast switcher theme-switcher', - target: 'body', - }); - themeSwitcher.init(); +themeSwitcher.addButton({ + tag: 'BUTTON', + class: 'contrast switcher theme-switcher', + target: 'body', }); +themeSwitcher.init(); |