diff options
author | Andrew Dolgov <[email protected]> | 2021-02-24 21:56:52 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-24 21:56:52 +0300 |
commit | 93940d2a9f80d9e1dac49b5eb7db23230d31c5f6 (patch) | |
tree | 71016661f6017918d0934eb462bd9552018d557a /js/utility.js | |
parent | 8b022c2bfb356d7dddaf334bc931d6dec77086fb (diff) | |
parent | 1adacd057230aea4ede29dab510385bf01cf99a3 (diff) |
Merge branch 'master' of git.fakecake.org:fox/tt-rss into weblate-integration
Diffstat (limited to 'js/utility.js')
-rw-r--r-- | js/utility.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/js/utility.js b/js/utility.js index eef1c6b61..43ad5644e 100644 --- a/js/utility.js +++ b/js/utility.js @@ -2,7 +2,7 @@ /* TODO: this should probably be something like night_mode.js since it does nothing specific to utility scripts */ -Event.observe(window, "load", function() { +window.addEventListener("load", function() { const UtilityJS = { apply_night_mode: function (is_night, link) { console.log("night mode changed to", is_night); @@ -16,10 +16,10 @@ Event.observe(window, "load", function() { setup_night_mode: function() { const mql = window.matchMedia('(prefers-color-scheme: dark)'); - const link = new Element("link", { - rel: "stylesheet", - id: "theme_auto_css" - }); + const link = document.createElement("link"); + + link.rel = "stylesheet"; + link.id = "theme_auto_css"; link.onload = function() { document.querySelector("body").removeClassName("css_loading"); |