From 81bd2378ffa753e851390c2616e66a71d23c9989 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 9 Feb 2021 12:16:25 -0500
Subject: started to cleanup LinkDocPreview, LinkMenu.

---
 .../views/nodes/formattedText/FormattedTextBoxComment.tsx      | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

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

diff --git a/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx b/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx
index 05f0fefd8..d1bb2ad84 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx
@@ -136,8 +136,6 @@ export class FormattedTextBoxComment {
     @undoBatch
     deleteLink = action(() => {
         FormattedTextBoxComment.linkDoc ? LinkManager.Instance.deleteLink(FormattedTextBoxComment.linkDoc) : null;
-        LinkDocPreview.LinkInfo = undefined;
-        DocumentLinksButton.EditLink = undefined;
         FormattedTextBoxComment.Hide();
     });
 
@@ -158,6 +156,7 @@ export class FormattedTextBoxComment {
         FormattedTextBoxComment.tooltip && (FormattedTextBoxComment.tooltip.style.display = "");
     }
 
+    @action
     static showCommentbox(set: string, view: EditorView, nbef: number) {
         const state = view.state;
         if (set !== "none") {
@@ -171,6 +170,13 @@ export class FormattedTextBoxComment {
             const left = Math.max((start.left + end.left) / 2, start.left + 3);
             FormattedTextBoxComment.tooltip.style.left = (left - box.left) + "px";
             FormattedTextBoxComment.tooltip.style.bottom = (box.bottom - start.top) + "px";
+            // const props = FormattedTextBoxComment.textBox?.props.docViewPath.lastElement().props;
+            // props && (LinkDocPreview.SetLinkInfo({
+            //     docprops: props,
+            //     linkSrc: props.Document,
+            //     linkDoc: FormattedTextBoxComment.linkDoc,
+            //     Location: [start.left, start.top + 25]
+            // });
         }
         FormattedTextBoxComment.tooltip && (FormattedTextBoxComment.tooltip.style.display = set);
     }
-- 
cgit v1.2.3-70-g09d2

