aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/Annotation.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/pdf/Annotation.tsx')
-rw-r--r--src/client/views/pdf/Annotation.tsx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/client/views/pdf/Annotation.tsx b/src/client/views/pdf/Annotation.tsx
index 5ec564e7b..78438e7e3 100644
--- a/src/client/views/pdf/Annotation.tsx
+++ b/src/client/views/pdf/Annotation.tsx
@@ -8,6 +8,7 @@ import { Cast, FieldValue, NumCast, StrCast, PromiseValue } from "../../../field
import { DocumentManager } from "../../util/DocumentManager";
import { PDFMenu } from "./PDFMenu";
import "./Annotation.scss";
+import { undoBatch } from "../../util/UndoManager";
interface IAnnotationProps {
anno: Doc;
@@ -86,6 +87,14 @@ class RegionAnnotation extends React.Component<IRegionAnnotationProps> {
group && this.props.pinToPres(group, isPinned);
}
+ @undoBatch
+ makePushpin = action(() => {
+ const group = Cast(this.props.document.group, Doc, null);
+ group.isPushpin = !group.isPushpin;
+ })
+
+ isPushpin = () => Cast(this.props.document.group, Doc, null).isPushpin;
+
@action
onPointerDown = (e: React.PointerEvent) => {
if (e.button === 2 || e.ctrlKey) {
@@ -94,6 +103,8 @@ class RegionAnnotation extends React.Component<IRegionAnnotationProps> {
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);
e.stopPropagation();
}