aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/Annotation.tsx
diff options
context:
space:
mode:
authorLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-09-09 22:18:39 -0700
committerLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-09-09 22:18:39 -0700
commit1b8eb5a59edfcef36e8f6450aca82de46d2044eb (patch)
treee9f4aaaa27c71ca51fca9ee18af00d88b827574c /src/client/views/pdf/Annotation.tsx
parente641fd8c6f5a84800af173db02bd012eecb04b7a (diff)
parent5a4dad460f611cb8138faf08796dda4763f4daf4 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into bug_fixes
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