From 702ba59ac0235e24121ffff9fcca7c35717867ab Mon Sep 17 00:00:00 2001 From: geireann Date: Thu, 26 Aug 2021 12:40:42 -0400 Subject: hopefully ready! --- src/client/views/nodes/button/FontIconBox.tsx | 53 +++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 4 deletions(-) (limited to 'src/client/views/nodes/button') diff --git a/src/client/views/nodes/button/FontIconBox.tsx b/src/client/views/nodes/button/FontIconBox.tsx index 5d82fe123..745a85b21 100644 --- a/src/client/views/nodes/button/FontIconBox.tsx +++ b/src/client/views/nodes/button/FontIconBox.tsx @@ -164,7 +164,7 @@ export class FontIconBox extends DocComponent(Fon e.stopPropagation(); e.preventDefault(); }} - onDoubleClick={action(() => this.rootDoc.dropDownOpen = !this.rootDoc.dropDownOpen)} + onClick={action(() => this.rootDoc.dropDownOpen = !this.rootDoc.dropDownOpen)} > StrCast(i.rootDoc.type) === DocumentType.RTF).map(dv => dv.props.Document.bold = !dv.props.Document.bold); Doc.UserDoc().bold = !Doc.UserDoc().bold; @@ -720,7 +739,10 @@ Scripting.addGlobal(function toggleUnderline(checkResult?: boolean) { else return "transparent"; } const editorView = RichTextMenu.Instance.TextView?.EditorView; - + if (editorView){ + console.log("editorView"); + editorView?.state && RichTextMenu.Instance.toggleUnderline(editorView, true); + } SelectionManager.Views().filter(i => StrCast(i.rootDoc.type) === DocumentType.RTF).map(dv => dv.props.Document.underline = !dv.props.Document.underline); Doc.UserDoc().underline = !Doc.UserDoc().underline; return Doc.UserDoc().underline; @@ -732,7 +754,10 @@ Scripting.addGlobal(function toggleItalic(checkResult?: boolean) { else return "transparent"; } const editorView = RichTextMenu.Instance.TextView?.EditorView; - + if (editorView){ + console.log("editorView"); + editorView?.state && RichTextMenu.Instance.toggleItalic(editorView, true); + } SelectionManager.Views().filter(i => StrCast(i.rootDoc.type) === DocumentType.RTF).map(dv => dv.props.Document.italic = !dv.props.Document.italic); Doc.UserDoc().italic = !Doc.UserDoc().italic; return Doc.UserDoc().italic; @@ -815,4 +840,24 @@ Scripting.addGlobal(function webSetURL(url: string, checkResult?: boolean) { else if (selected && selected.type === DocumentType.WEB){ selected.data = url; } +}); + + +/** Schema + * toggleSchemaPreview + **/ + Scripting.addGlobal(function toggleSchemaPreview(checkResult?: boolean) { + const selected = SelectionManager.Views().length ? SelectionManager.Views()[0].rootDoc : undefined; + if (checkResult && selected){ + const result:boolean = NumCast(selected.schemaPreviewWidth) > 0; + if (result) return Colors.MEDIUM_BLUE; + else return "transparent"; + } + else if (selected){ + if (NumCast(selected.schemaPreviewWidth) > 0){ + selected.schemaPreviewWidth = 200; + } else { + selected.schemaPreviewWidth = 0; + } + } }); \ No newline at end of file -- cgit v1.2.3-70-g09d2