diff options
| author | bobzel <zzzman@gmail.com> | 2021-09-13 13:58:07 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2021-09-13 13:58:07 -0400 |
| commit | 527b5a9dcd61f898c222eac0f2d5569bcfa35f5e (patch) | |
| tree | 373ca6eea64debb5787972325841cf399e854f45 /src/client/views/nodes/button/FontIconBox.tsx | |
| parent | ce7e33562775b4cd4671dadd2d2fa9d448bc0290 (diff) | |
| parent | e4c35687663dc61f03493dc3109b5dcbd6795a4b (diff) | |
Merge branch 'master' of https://github.com/brown-dash/Dash-Web
Diffstat (limited to 'src/client/views/nodes/button/FontIconBox.tsx')
| -rw-r--r-- | src/client/views/nodes/button/FontIconBox.tsx | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/client/views/nodes/button/FontIconBox.tsx b/src/client/views/nodes/button/FontIconBox.tsx index b1d74261b..fb96969c5 100644 --- a/src/client/views/nodes/button/FontIconBox.tsx +++ b/src/client/views/nodes/button/FontIconBox.tsx @@ -522,7 +522,6 @@ export class FontIconBox extends DocComponent<ButtonProps, FontIconDocument>(Fon // button = <TextButton {...buttonProps}></TextButton> break; case ButtonType.EditableText: - console.log("Editable text"); button = this.editableText; break; case ButtonType.NumberButton: @@ -592,7 +591,6 @@ Scripting.addGlobal(function setBackgroundColor(color?: string, checkResult?: bo const selected = SelectionManager.Docs().lastElement(); if (checkResult) { if (selected) { - console.log("[Background] (selected): " + StrCast(selected._backgroundColor)); return selected._backgroundColor; } else { return "#FFFFFF"; @@ -685,14 +683,12 @@ Scripting.addGlobal(function setBulletList(mapStyle: "bullet" | "decimal", check const editorView = RichTextMenu.Instance?.TextView?.EditorView; if (checkResult) { const active = editorView?.state && RichTextMenu.Instance.getActiveListStyle(); - console.log(active, mapStyle); if (active === mapStyle) return Colors.MEDIUM_BLUE; else return "transparent"; } if (editorView) { const active = editorView?.state && RichTextMenu.Instance.getActiveListStyle(); if (active === mapStyle) { - console.log("set bullet list"); editorView?.state && RichTextMenu.Instance.changeListType(editorView.state.schema.nodes.ordered_list.create({ mapStyle: "" })); } else { editorView?.state && RichTextMenu.Instance.changeListType(editorView.state.schema.nodes.ordered_list.create({ mapStyle: mapStyle })); @@ -707,10 +703,8 @@ Scripting.addGlobal(function setFontColor(color?: string, checkResult?: boolean) if (checkResult) { if (selected) { - console.log("[Font color] (selected): " + StrCast(selected._fontColor)); return selected._fontColor; } else { - console.log("[Font color] (global): " + StrCast(Doc.UserDoc()._fontColor)); return Doc.UserDoc()._fontColor; } } @@ -760,12 +754,16 @@ Scripting.addGlobal(function setFontSize(size: string, checkResult?: boolean) { Scripting.addGlobal(function toggleBold(checkResult?: boolean) { if (checkResult) { - if (Doc.UserDoc().bold) return Colors.MEDIUM_BLUE; + const editorView = RichTextMenu.Instance.TextView?.EditorView; + if (editorView) { + const bold: boolean = editorView?.state && RichTextMenu.Instance.getBoldStatus(); + if (bold) return Colors.MEDIUM_BLUE; + else return "transparent"; + } else return "transparent"; } const editorView = RichTextMenu.Instance.TextView?.EditorView; if (editorView) { - console.log("editorView"); editorView?.state && RichTextMenu.Instance.toggleBold(editorView, true); } SelectionManager.Docs().filter(doc => StrCast(doc.type) === DocumentType.RTF).map(doc => doc.bold = !doc.bold); @@ -775,12 +773,10 @@ Scripting.addGlobal(function toggleBold(checkResult?: boolean) { Scripting.addGlobal(function toggleUnderline(checkResult?: boolean) { if (checkResult) { - if (Doc.UserDoc().underline) return Colors.MEDIUM_BLUE; - else return "transparent"; + return "transparent"; } const editorView = RichTextMenu.Instance.TextView?.EditorView; if (editorView) { - console.log("editorView"); editorView?.state && RichTextMenu.Instance.toggleUnderline(editorView, true); } SelectionManager.Docs().filter(doc => StrCast(doc.type) === DocumentType.RTF).map(doc => doc.underline = !doc.underline); @@ -790,12 +786,10 @@ Scripting.addGlobal(function toggleUnderline(checkResult?: boolean) { Scripting.addGlobal(function toggleItalic(checkResult?: boolean) { if (checkResult) { - if (Doc.UserDoc().italic) return Colors.MEDIUM_BLUE; - else return "transparent"; + return "transparent"; } const editorView = RichTextMenu.Instance.TextView?.EditorView; if (editorView) { - console.log("editorView"); editorView?.state && RichTextMenu.Instance.toggleItalic(editorView, true); } SelectionManager.Docs().filter(doc => StrCast(doc.type) === DocumentType.RTF).map(doc => doc.italic = !doc.italic); @@ -909,7 +903,6 @@ Scripting.addGlobal(function webBack() { **/ Scripting.addGlobal(function toggleSchemaPreview(checkResult?: boolean) { const selected = SelectionManager.Docs().lastElement(); - console.log(selected && selected.title); if (checkResult && selected) { const result: boolean = NumCast(selected.schemaPreviewWidth) > 0; if (result) return Colors.MEDIUM_BLUE; |
