aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/DashDocCommentView.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-06-16 21:16:54 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-06-16 21:16:54 -0400
commit3afdfa11e35bcb73dd4a871e5e4489b0dd3a3c95 (patch)
tree6e600ff70138e542de490e76fc907601be14d799 /src/client/views/nodes/formattedText/DashDocCommentView.tsx
parent7b3c348de46b07d3296fff1cafba13e568ef7494 (diff)
fixed problems with scriptingBox types & cleaned up code.
Diffstat (limited to 'src/client/views/nodes/formattedText/DashDocCommentView.tsx')
-rw-r--r--src/client/views/nodes/formattedText/DashDocCommentView.tsx22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/client/views/nodes/formattedText/DashDocCommentView.tsx b/src/client/views/nodes/formattedText/DashDocCommentView.tsx
index ad204f3df..5c75a589a 100644
--- a/src/client/views/nodes/formattedText/DashDocCommentView.tsx
+++ b/src/client/views/nodes/formattedText/DashDocCommentView.tsx
@@ -43,24 +43,24 @@ interface IDashDocCommentViewInternal {
export class DashDocCommentViewInternal extends React.Component<IDashDocCommentViewInternal>{
constructor(props: IDashDocCommentViewInternal) {
- super(props)
- this.onPointerLeaveCollapsed = this.onPointerLeaveCollapsed.bind(this)
- this.onPointerEnterCollapsed = this.onPointerEnterCollapsed.bind(this)
- this.onPointerUpCollapsed = this.onPointerUpCollapsed.bind(this)
- this.onPointerDownCollapsed = this.onPointerDownCollapsed.bind(this)
+ super(props);
+ this.onPointerLeaveCollapsed = this.onPointerLeaveCollapsed.bind(this);
+ this.onPointerEnterCollapsed = this.onPointerEnterCollapsed.bind(this);
+ this.onPointerUpCollapsed = this.onPointerUpCollapsed.bind(this);
+ this.onPointerDownCollapsed = this.onPointerDownCollapsed.bind(this);
}
onPointerLeaveCollapsed(e: any) {
DocServer.GetRefField(this.props.docid).then(async dashDoc => dashDoc instanceof Doc && Doc.linkFollowUnhighlight());
e.preventDefault();
e.stopPropagation();
- };
+ }
onPointerEnterCollapsed(e: any) {
DocServer.GetRefField(this.props.docid).then(async dashDoc => dashDoc instanceof Doc && Doc.linkFollowHighlight(dashDoc, false));
e.preventDefault();
e.stopPropagation();
- };
+ }
onPointerUpCollapsed(e: any) {
const target = this.targetNode();
@@ -75,11 +75,11 @@ export class DashDocCommentViewInternal extends React.Component<IDashDocCommentV
}, 0);
}
e.stopPropagation();
- };
+ }
onPointerDownCollapsed(e: any) {
e.stopPropagation();
- };
+ }
targetNode = () => { // search forward in the prosemirror doc for the attached dashDocNode that is the target of the comment anchor
const state = this.props.view.state;
@@ -94,7 +94,7 @@ export class DashDocCommentViewInternal extends React.Component<IDashDocCommentV
this.props.view.dispatch(state.tr.insert(this.props.getPos() + 1, dashDoc));
setTimeout(() => { try { this.props.view.dispatch(state.tr.setSelection(TextSelection.create(state.tr.doc, this.props.getPos() + 2))); } catch (e) { } }, 0);
return undefined;
- };
+ }
render() {
return (
@@ -107,6 +107,6 @@ export class DashDocCommentViewInternal extends React.Component<IDashDocCommentV
onPointerDown={this.onPointerDownCollapsed}
>
</span>
- )
+ );
}
}