diff options
Diffstat (limited to 'src/client/views/nodes/button/FontIconBox.tsx')
-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"); |