From 8c224d49d3f0ecd5fd51656ad9414b34db24a7e0 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Sun, 24 Sep 2023 21:54:12 +0200 Subject: [PATCH] fixed: apply colors when selecting theme fixed: hide colors when hidding editor changed: md header in italics --- main.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/main.js b/main.js index b298935..2ed81bd 100644 --- a/main.js +++ b/main.js @@ -605,6 +605,7 @@ function loadtheme(theme) settings[i] = themes[theme][i]; } applystyle(); + applycolors(); resize(); } @@ -725,12 +726,22 @@ function connected(note) return result; } +function toggleeditor(hidden) +{ + md.hidden = hidden; + + if (settings.colors) + { + colored.hidden = hidden; + } +} + function shownotelinks() { if (settings.enablenetwork) { networkpage.hidden = false; - md.hidden = true; + toggleeditor(true); function id(note) { return localdata.indexOf(note); @@ -796,7 +807,7 @@ function shownotelinks() graph.on("click", function(event) { networkpage.hidden = true; - md.hidden = false; + toggleeditor(false); loadnote(nodes.find(n => n.id == event.nodes[0]).label); }); } @@ -2099,7 +2110,7 @@ function applycolors() { header = false; } - line = "" + line + ""; + line = "" + line + ""; } if (line == "```" && !code) @@ -2355,7 +2366,7 @@ function esc(event) else if (networkpage.hidden == false) { networkpage.hidden = true; - md.hidden = false; + toggleeditor(false); } else if (preview.hidden == false) { @@ -2557,7 +2568,7 @@ function insertautocomplete(selectednote) function togglepreview() { preview.innerHTML = md2html(md.value); - md.hidden = !md.hidden; + toggleeditor(!md.hidden); preview.hidden = !preview.hidden; if (preview.hidden) @@ -2610,7 +2621,7 @@ function togglepreviewwithsubs() if (note) { preview.innerHTML = md2html(note.content); - md.hidden = !md.hidden; + toggleeditor(!md.hidden); preview.hidden = !preview.hidden; if (preview.hidden)