aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/Annotation.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-09-09 13:07:33 -0400
committerbobzel <zzzman@gmail.com>2020-09-09 13:07:33 -0400
commit320f18503439c7e490f259ed2ed7355ff72b4237 (patch)
tree69fc716767970cfaffa9608a6d1b074b3a1ffb86 /src/client/views/pdf/Annotation.tsx
parent262361a9df317259e5182124f18537d4d3c14c43 (diff)
fixed unpnning pdf annotations. remvoed unused UI from PDFmenu
Diffstat (limited to 'src/client/views/pdf/Annotation.tsx')
-rw-r--r--src/client/views/pdf/Annotation.tsx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/pdf/Annotation.tsx b/src/client/views/pdf/Annotation.tsx
index 222a6cb0f..5ec564e7b 100644
--- a/src/client/views/pdf/Annotation.tsx
+++ b/src/client/views/pdf/Annotation.tsx
@@ -12,7 +12,7 @@ import "./Annotation.scss";
interface IAnnotationProps {
anno: Doc;
addDocTab: (document: Doc, where: string) => boolean;
- pinToPres: (document: Doc) => void;
+ pinToPres: (document: Doc, unpin?: boolean) => void;
focus: (doc: Doc) => void;
dataDoc: Doc;
fieldKey: string;
@@ -22,8 +22,8 @@ interface IAnnotationProps {
export
class Annotation extends React.Component<IAnnotationProps> {
render() {
- return DocListCast(this.props.anno.annotations).map(a => (
- <RegionAnnotation {...this.props} document={a} x={NumCast(a.x)} y={NumCast(a.y)} width={a[WidthSym]()} height={a[HeightSym]()} key={a[Id]} />));
+ return DocListCast(this.props.anno.annotations).map(a =>
+ <RegionAnnotation {...this.props} pinToPres={this.props.pinToPres} document={a} x={NumCast(a.x)} y={NumCast(a.y)} width={a[WidthSym]()} height={a[HeightSym]()} key={a[Id]} />);
}
}
@@ -33,7 +33,7 @@ interface IRegionAnnotationProps {
width: number;
height: number;
addDocTab: (document: Doc, where: string) => boolean;
- pinToPres: (document: Doc) => void;
+ pinToPres: (document: Doc, unpin: boolean) => void;
document: Doc;
dataDoc: Doc;
fieldKey: string;
@@ -82,7 +82,8 @@ class RegionAnnotation extends React.Component<IRegionAnnotationProps> {
pinToPres = () => {
const group = FieldValue(Cast(this.props.document.group, Doc));
- group && this.props.pinToPres(group);
+ const isPinned = group && Doc.isDocPinned(group) ? true : false;
+ group && this.props.pinToPres(group, isPinned);
}
@action