aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/Annotation.tsx
diff options
context:
space:
mode:
authorLionel Han <47760119+IGoByJoe@users.noreply.github.com>2021-01-21 17:31:47 -0800
committerLionel Han <47760119+IGoByJoe@users.noreply.github.com>2021-01-21 17:31:47 -0800
commit78dd6b82033961a06dfb3ad3218763fa4c08d761 (patch)
tree85752b8be1cc9bd50ec8a38cfd11e08e4efbebb1 /src/client/views/pdf/Annotation.tsx
parentf0a5763946d6b717fb745f2216dc1e681e3e0c68 (diff)
parent10b759d2bd09af3a8e8a4effbc8fd2312dd873d2 (diff)
pull
Diffstat (limited to 'src/client/views/pdf/Annotation.tsx')
-rw-r--r--src/client/views/pdf/Annotation.tsx26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/client/views/pdf/Annotation.tsx b/src/client/views/pdf/Annotation.tsx
index 5ef57f986..cd32c2c3a 100644
--- a/src/client/views/pdf/Annotation.tsx
+++ b/src/client/views/pdf/Annotation.tsx
@@ -8,7 +8,7 @@ import { BoolCast, Cast, FieldValue, NumCast, PromiseValue, StrCast } from "../.
import { LinkManager } from "../../util/LinkManager";
import { undoBatch } from "../../util/UndoManager";
import "./Annotation.scss";
-import { PDFMenu } from "./PDFMenu";
+import { AnchorMenu } from "./AnchorMenu";
interface IAnnotationProps {
anno: Doc;
@@ -67,8 +67,8 @@ class RegionAnnotation extends React.Component<IRegionAnnotationProps> {
}
componentWillUnmount() {
- this._brushDisposer && this._brushDisposer();
- this._reactionDisposer && this._reactionDisposer();
+ this._brushDisposer?.();
+ this._reactionDisposer?.();
}
@undoBatch
@@ -83,8 +83,8 @@ class RegionAnnotation extends React.Component<IRegionAnnotationProps> {
DocListCast(group.annotations).forEach(anno => anno.delete = true);
}
-
- PDFMenu.Instance.fadeOut(true);
+ AnchorMenu.Instance.fadeOut(true);
+ this.props.select(false);
}
@undoBatch
@@ -105,14 +105,14 @@ class RegionAnnotation extends React.Component<IRegionAnnotationProps> {
@action
onPointerDown = (e: React.PointerEvent) => {
if (e.button === 2 || e.ctrlKey) {
- PDFMenu.Instance.Status = "annotation";
- PDFMenu.Instance.Delete = this.deleteAnnotation.bind(this);
- PDFMenu.Instance.Pinned = false;
- PDFMenu.Instance.AddTag = this.addTag.bind(this);
- PDFMenu.Instance.PinToPres = this.pinToPres;
- PDFMenu.Instance.MakePushpin = this.makePushpin;
- PDFMenu.Instance.IsPushpin = this.isPushpin;
- PDFMenu.Instance.jumpTo(e.clientX, e.clientY, true);
+ AnchorMenu.Instance.Status = "annotation";
+ AnchorMenu.Instance.Delete = this.deleteAnnotation.bind(this);
+ AnchorMenu.Instance.Pinned = false;
+ AnchorMenu.Instance.AddTag = this.addTag.bind(this);
+ AnchorMenu.Instance.PinToPres = this.pinToPres;
+ AnchorMenu.Instance.MakePushpin = this.makePushpin;
+ AnchorMenu.Instance.IsPushpin = this.isPushpin;
+ AnchorMenu.Instance.jumpTo(e.clientX, e.clientY, true);
e.stopPropagation();
}
else if (e.button === 0) {