diff --git a/ts/editor/ColorButtons.svelte b/ts/editor/ColorButtons.svelte index eac0cad46..cdb8f72f7 100644 --- a/ts/editor/ColorButtons.svelte +++ b/ts/editor/ColorButtons.svelte @@ -25,10 +25,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html const wrapWithBackcolor = (color: string) => () => { document.execCommand("backcolor", false, color); }; + + const initialColor = "black"; + + let forecolorWrap = wrapWithForecolor(initialColor); + let backcolorWrap = wrapWithForecolor(initialColor); - + @@ -38,7 +43,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html shortcutLabel )} {disabled} - on:click={wrapWithForecolor(color)} + on:click={forecolorWrap} on:mount={createShortcut} > {@html textColorIcon} @@ -58,17 +63,23 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html widthMultiplier={0.5} > {@html arrowIcon} - + { + forecolorWrap = wrapWithForecolor(setColor(event)); + forecolorWrap(); + }} + on:mount={createShortcut} + /> - + - + {@html highlightColorIcon} {@html colorHelperIcon} @@ -81,7 +92,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html {disabled} > {@html arrowIcon} - + { + backcolorWrap = wrapWithBackcolor(setColor(event)); + backcolorWrap(); + }} + /> diff --git a/ts/editor/WithColorHelper.svelte b/ts/editor/WithColorHelper.svelte index 77c5ee9e6..74612bf9d 100644 --- a/ts/editor/WithColorHelper.svelte +++ b/ts/editor/WithColorHelper.svelte @@ -5,15 +5,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
- +