diff options
| author | bobzel <zzzman@gmail.com> | 2020-09-15 12:06:15 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-09-15 12:06:15 -0400 |
| commit | 45c2bf0a22ae83a65d91f11934e1c21770b897c7 (patch) | |
| tree | 1fa0ca1f31daeefccb63b90bb2ae5e0dd281e403 /src/client/views/pdf/Annotation.tsx | |
| parent | 40033dedb5319aa0fd00ff3156d6bb19015dfdfe (diff) | |
simplifying menus for annotations. added target toggle option to PDFmenu
Diffstat (limited to 'src/client/views/pdf/Annotation.tsx')
| -rw-r--r-- | src/client/views/pdf/Annotation.tsx | 11 |
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(); } |
