fix: trying to call applycolors not too often
This commit is contained in:
parent
a685285177
commit
37de87fd3a
6
main.js
6
main.js
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue