diff options
author | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-06-17 12:14:55 -0500 |
---|---|---|
committer | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-06-17 12:14:55 -0500 |
commit | 1126d544382e192f4d36ea2b8d2320d3b47311ca (patch) | |
tree | d79cea7015f06dd98f27b19457210f0814012c8b /src/client/views/nodes/formattedText/DashDocCommentView.tsx | |
parent | 9018ac91f926df133738c86225838cfebdcf2270 (diff) | |
parent | 375786198596ce8dcab06c39c5b4ffcca4a78b88 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into anika_schema_view
Diffstat (limited to 'src/client/views/nodes/formattedText/DashDocCommentView.tsx')
-rw-r--r-- | src/client/views/nodes/formattedText/DashDocCommentView.tsx | 22 |
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> - ) + ); } } |