fix: trying to call applycolors not too often

This commit is contained in:
quenousimporte 2023-10-11 21:24:20 +02:00
parent a685285177
commit 37de87fd3a
1 changed files with 3 additions and 3 deletions

View File

@ -315,8 +315,6 @@ var snippets = [
function seteditorcontent(content, silent) function seteditorcontent(content, silent)
{ {
md.value = content; md.value = content;
applycolors();
if (!silent) if (!silent)
{ {
datachanged(); datachanged();
@ -1236,6 +1234,7 @@ function applystyle()
{ {
title.style.color = settings.accentcolor; title.style.color = settings.accentcolor;
} }
applycolors();
} }
function loadsettings() function loadsettings()
@ -1264,7 +1263,6 @@ function loadsettings()
colored.hidden = !settings.colors; colored.hidden = !settings.colors;
md.style.color = settings.colors ? "transparent" : "inherit"; md.style.color = settings.colors ? "transparent" : "inherit";
md.style.background = settings.colors ? "transparent" : "inherit"; md.style.background = settings.colors ? "transparent" : "inherit";
applycolors();
} }
function checksaved() function checksaved()
@ -2132,6 +2130,7 @@ function applycolors()
function datachanged() function datachanged()
{ {
applycolors();
resize(); resize();
saved = false; saved = false;
@ -2743,6 +2742,7 @@ function bindfile(note)
setwindowtitle(); setwindowtitle();
seteditorcontent(note.content || "", true); seteditorcontent(note.content || "", true);
applycolors();
preview.innerHTML = md2html(md.value); preview.innerHTML = md2html(md.value);
if (changed) if (changed)