From 702ba59ac0235e24121ffff9fcca7c35717867ab Mon Sep 17 00:00:00 2001
From: geireann <geireann.lindfield@gmail.com>
Date: Thu, 26 Aug 2021 12:40:42 -0400
Subject: hopefully ready!

---
 .../views/nodes/formattedText/RichTextMenu.tsx     | 32 ++++++++++++----------
 1 file changed, 17 insertions(+), 15 deletions(-)

(limited to 'src/client/views/nodes/formattedText/RichTextMenu.tsx')

diff --git a/src/client/views/nodes/formattedText/RichTextMenu.tsx b/src/client/views/nodes/formattedText/RichTextMenu.tsx
index 4f40b59f2..3d9d9543d 100644
--- a/src/client/views/nodes/formattedText/RichTextMenu.tsx
+++ b/src/client/views/nodes/formattedText/RichTextMenu.tsx
@@ -280,14 +280,21 @@ export class RichTextMenu extends AntimodeMenu<AntimodeMenuProps>   {
     }
 
     toggleBold = (view: EditorView, forceBool?:boolean) => {
-        if (forceBool) { 
-            const mark = view.state.schema.marks.bold.create({bold: true});
-            this.setMark(mark, view.state, view.dispatch, true);
-        }
-        else {
-            console.log(toggleMark);
-            toggleMark(view.state.schema.marks.bold);
-        }
+        const mark = view.state.schema.mark(view.state.schema.marks.strong, {strong: forceBool});
+        this.setMark(mark, view.state, view.dispatch, false);
+        view.focus();
+    }
+
+    toggleUnderline = (view: EditorView, forceBool?:boolean) => {
+        const mark = view.state.schema.mark(view.state.schema.marks.underline, {underline: forceBool});
+        this.setMark(mark, view.state, view.dispatch, false);
+        view.focus();
+    }
+
+    toggleItalic = (view: EditorView, forceBool?:boolean) => {
+        const mark = view.state.schema.mark(view.state.schema.marks.em, {em: forceBool});
+        this.setMark(mark, view.state, view.dispatch, false);
+        view.focus();
     }
 
 
@@ -323,7 +330,7 @@ export class RichTextMenu extends AntimodeMenu<AntimodeMenuProps>   {
     }
 
     // TODO: remove doesn't work
-    //remove all node type and apply the passed-in one to the selected text
+    // remove all node type and apply the passed-in one to the selected text
     changeListType = (nodeType: Node | undefined) => {
         if (!this.view || (nodeType as any)?.attrs.mapStyle === "") return;
 
@@ -653,6 +660,7 @@ export class RichTextMenu extends AntimodeMenu<AntimodeMenuProps>   {
     }
 
     render() {
+        return null;
         // TraceMobx();
         // const row1 = <div className="antimodeMenu-row" key="row 1" style={{ display: this.collapsed ? "none" : undefined }}>{[
         //     //!this.collapsed ? this.getDragger() : (null),
@@ -715,12 +723,6 @@ export class RichTextMenu extends AntimodeMenu<AntimodeMenuProps>   {
         //         </button>
         //     </div> */}
         // </div>;
-
-        return (
-            <div className="richTextMenu">
-                {/* {this.getElementWithRows([row1, row2], 2, false)} */}
-            </div>
-        );
     }
 }
 
-- 
cgit v1.2.3-70-g09d2

