mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2026-01-01 14:52:08 -08:00
Fix dark mode event handling
Previous code worked but this matches the spec, and works on iOS
This commit is contained in:
parent
6c98bb706a
commit
94ffb50e04
1 changed files with 1 additions and 1 deletions
|
|
@ -40,7 +40,7 @@ exports.getInfoTiddlerFields = function(updateInfoTiddlersCallback) {
|
|||
var mqList = window.matchMedia("(prefers-color-scheme: dark)"),
|
||||
getDarkModeTiddler = function() {return {title: "$:/info/darkmode", text: mqList.matches ? "yes" : "no"};};
|
||||
infoTiddlerFields.push(getDarkModeTiddler());
|
||||
mqList.addEventListener("change", function(event) {
|
||||
mqList.addListener(function(event) {
|
||||
updateInfoTiddlersCallback([getDarkModeTiddler()]);
|
||||
});
|
||||
// Language
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue