From 37de87fd3ab33fd01439684c8c077705d80a9042 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Wed, 11 Oct 2023 21:24:20 +0200 Subject: [PATCH] fix: trying to call applycolors not too often --- main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 6f1b841..d0bb09d 100644 --- a/main.js +++ b/main.js @@ -315,8 +315,6 @@ var snippets = [ function seteditorcontent(content, silent) { md.value = content; - applycolors(); - if (!silent) { datachanged(); @@ -1236,6 +1234,7 @@ function applystyle() { title.style.color = settings.accentcolor; } + applycolors(); } function loadsettings() @@ -1264,7 +1263,6 @@ function loadsettings() colored.hidden = !settings.colors; md.style.color = settings.colors ? "transparent" : "inherit"; md.style.background = settings.colors ? "transparent" : "inherit"; - applycolors(); } function checksaved() @@ -2132,6 +2130,7 @@ function applycolors() function datachanged() { + applycolors(); resize(); saved = false; @@ -2743,6 +2742,7 @@ function bindfile(note) setwindowtitle(); seteditorcontent(note.content || "", true); + applycolors(); preview.innerHTML = md2html(md.value); if (changed)