From 45c2bf0a22ae83a65d91f11934e1c21770b897c7 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 15 Sep 2020 12:06:15 -0400
Subject: simplifying menus for annotations.  added target toggle option to
 PDFmenu

---
 src/client/views/pdf/Annotation.tsx | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'src/client/views/pdf/Annotation.tsx')

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();
         }
-- 
cgit v1.2.3-70-g09d2

