mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00: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
@ -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…
Reference in New Issue
Block a user