diff options
| author | geireann <geireann.lindfield@gmail.com> | 2021-08-26 11:06:17 -0400 |
|---|---|---|
| committer | geireann <geireann.lindfield@gmail.com> | 2021-08-26 11:06:17 -0400 |
| commit | cf7beac8b1de637fb4c0de86234ab617798d9379 (patch) | |
| tree | 7b60834f9ee27f839a02d0cee4aa08007e5bbfb5 /src/client/views/nodes/button/FontIconBox.tsx | |
| parent | c1fb227c364af5defb99adc793e850d681caa36a (diff) | |
added toggleBold
Diffstat (limited to 'src/client/views/nodes/button/FontIconBox.tsx')
| -rw-r--r-- | src/client/views/nodes/button/FontIconBox.tsx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/client/views/nodes/button/FontIconBox.tsx b/src/client/views/nodes/button/FontIconBox.tsx index e09e15a60..5d82fe123 100644 --- a/src/client/views/nodes/button/FontIconBox.tsx +++ b/src/client/views/nodes/button/FontIconBox.tsx @@ -591,10 +591,6 @@ Scripting.addGlobal(function toggleOverlay(checkResult?: boolean) { * toggleItalic * toggleUnderline **/ -Scripting.addGlobal(function toggleBold(){ - const editorView = RichTextMenu.Instance.TextView?.EditorView; -}); - // toggle: Set overlay status of selected document Scripting.addGlobal(function setFont(font: string, checkResult?: boolean) { @@ -708,7 +704,12 @@ Scripting.addGlobal(function toggleBold(checkResult?: boolean) { if (Doc.UserDoc().bold) return Colors.MEDIUM_BLUE; else return "transparent"; } - SelectionManager.Views().filter(i => StrCast(i.rootDoc.type) === DocumentType.RTF).map(dv => dv.props.Document.italic = !dv.props.Document.italic); + const editorView = RichTextMenu.Instance.TextView?.EditorView; + if (editorView){ + console.log("editorView"); + editorView?.state && RichTextMenu.Instance.toggleBold(editorView); + } + SelectionManager.Views().filter(i => StrCast(i.rootDoc.type) === DocumentType.RTF).map(dv => dv.props.Document.bold = !dv.props.Document.bold); Doc.UserDoc().bold = !Doc.UserDoc().bold; return Doc.UserDoc().bold; }); @@ -718,7 +719,9 @@ Scripting.addGlobal(function toggleUnderline(checkResult?: boolean) { if (Doc.UserDoc().underline) return Colors.MEDIUM_BLUE; else return "transparent"; } - SelectionManager.Views().filter(i => StrCast(i.rootDoc.type) === DocumentType.RTF).map(dv => dv.props.Document.italic = !dv.props.Document.italic); + const editorView = RichTextMenu.Instance.TextView?.EditorView; + + 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; }); @@ -728,6 +731,8 @@ Scripting.addGlobal(function toggleItalic(checkResult?: boolean) { if (Doc.UserDoc().italic) return Colors.MEDIUM_BLUE; else return "transparent"; } + const editorView = RichTextMenu.Instance.TextView?.EditorView; + 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; |
