aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-02-12 13:33:36 -0500
committerbobzel <zzzman@gmail.com>2021-02-12 13:33:36 -0500
commitd30f5b4855a0ad500cc5784260128ecc269f6450 (patch)
tree07029628d8cccc0f4a0cb79f307bd376c3582404 /src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx
parentd0607264d955d90eca8178d5bfbc6a72f47fa872 (diff)
streamlined double-clicking to always open lightbox no matter what document you click on (except webbox's in native selection mode). shift -double-click re-centers a freeform view.
Diffstat (limited to 'src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx')
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx b/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx
index 89df5e246..900b702c6 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx
@@ -82,9 +82,10 @@ export class FormattedTextBoxComment {
FormattedTextBoxComment.tooltip.style.display = "";
}
- static update(view: EditorView, lastState?: EditorState, hrefs: string = "") {
- if (FormattedTextBoxComment.textBox && (hrefs || !lastState?.doc.eq(view.state.doc) || !lastState?.selection.eq(view.state.selection))) {
- FormattedTextBoxComment.setupPreview(view, FormattedTextBoxComment.textBox, hrefs ? hrefs.trim().split(" ") : undefined);
+ static update(textBox: FormattedTextBox, view: EditorView, lastState?: EditorState, hrefs: string = "") {
+ FormattedTextBoxComment.textBox = textBox;
+ if ((hrefs || !lastState?.doc.eq(view.state.doc) || !lastState?.selection.eq(view.state.selection))) {
+ FormattedTextBoxComment.setupPreview(view, textBox, hrefs ? hrefs.trim().split(" ") : undefined);
}
}