lightmode flashing fix
parent
e9b482e561
commit
69839f2a19
|
@ -5,6 +5,7 @@ MD.Darkmode = function(){
|
|||
if (!button) return false;
|
||||
|
||||
function set(isDark) {
|
||||
|
||||
button.setAttribute("title", isDark ? "Switch to lightmode" : "Switch to darkmode")
|
||||
body.classList.toggle("inverted", !isDark);
|
||||
body.classList.add("cancel-transitions");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
(function(){
|
||||
const canvasContent = localStorage.getItem("md-canvasContent");
|
||||
const isDark = localStorage.getItem("md-darkmode");
|
||||
document.body.classList.toggle("inverted", !isDark);
|
||||
if (!isDark) body.classList.add("inverted");
|
||||
if (!canvasContent) return;
|
||||
const parser = new DOMParser();
|
||||
const doc = parser.parseFromString(canvasContent, "image/svg+xml");
|
||||
|
|
Loading…
Reference in New Issue