aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/DashDocCommentView.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-06-16 23:24:33 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-06-16 23:24:33 -0400
commit78e2ab25c00d6dace4093326a6d7b2777951577c (patch)
tree42b3328619b61c04dc94691ae8a127abefdc7308 /src/client/views/nodes/formattedText/DashDocCommentView.tsx
parent3927564a9ff22af07490f0e98be3e8cbe1a4d3ab (diff)
parent9ead194ead1e603083945740e2b6e76130f23e18 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
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>
- )
+ );
}
}