diff options
author | bobzel <zzzman@gmail.com> | 2021-09-13 15:36:58 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-09-13 15:36:58 -0400 |
commit | 8c5fd1eb3c1ffb5bc17f5225a75f9dd2db40e460 (patch) | |
tree | a3bb1b41fb6b842a824b38acfe197585759b3a79 /src | |
parent | 3de58ee0196358d353e0d797d407aeb3e0ef383c (diff) |
from last
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/button/FontIconBox.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/nodes/button/FontIconBox.tsx b/src/client/views/nodes/button/FontIconBox.tsx index 40d5ad819..1997f4fa5 100644 --- a/src/client/views/nodes/button/FontIconBox.tsx +++ b/src/client/views/nodes/button/FontIconBox.tsx @@ -352,11 +352,8 @@ export class FontIconBox extends DocComponent<ButtonProps, FontIconDocument>(Fon </div>; const click = (value: ColorState) => { - const hex: string = value.hex; const s = ScriptField.MakeScript(script + '("' + Utils.colorString(value) + '", false)'); - if (s) { - undoBatch(() => s.script.run().result)(); - } + s && undoBatch(() => s.script.run().result)(); }; return ( <div className={`menuButton ${this.type} ${active}`} @@ -589,6 +586,9 @@ Scripting.addGlobal(function setBackgroundColor(color?: string, checkResult?: bo // toggle: Set overlay status of selected document Scripting.addGlobal(function setHeaderColor(color?: string, checkResult?: boolean) { + if (checkResult) { + return Doc.SharingDoc().userColor; + } Doc.SharingDoc().userColor = undefined; Doc.GetProto(Doc.SharingDoc()).userColor = color; Doc.UserDoc().showTitle = color === "transparent" ? undefined : StrCast(Doc.UserDoc().showTitle, "creationDate"); |