diff options
| author | laurawilsonri <laura_wilson@brown.edu> | 2019-04-15 20:20:46 -0400 |
|---|---|---|
| committer | laurawilsonri <laura_wilson@brown.edu> | 2019-04-15 20:20:46 -0400 |
| commit | b7a766aa5d53686e032b34d7213ad543108f12c3 (patch) | |
| tree | d71854e091fa24997a30856d9ac9c937a6cd45d2 /src/client/views/collections/CollectionBaseView.tsx | |
| parent | 8b1026d357dd40fc4a00010739d99ffc9db08641 (diff) | |
| parent | ff6ba4107aa33e021803399180b0d2844fc19d84 (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into richTextEditor
Diffstat (limited to 'src/client/views/collections/CollectionBaseView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionBaseView.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionBaseView.tsx b/src/client/views/collections/CollectionBaseView.tsx index b5eaab349..444f6fc26 100644 --- a/src/client/views/collections/CollectionBaseView.tsx +++ b/src/client/views/collections/CollectionBaseView.tsx @@ -1,4 +1,4 @@ -import { action } from 'mobx'; +import { action, computed } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; import { Document } from '../../../fields/Document'; @@ -80,12 +80,16 @@ export class CollectionBaseView extends React.Component<CollectionViewProps> { } return false; } + @computed get isAnnotationOverlay() { return this.props.fieldKey && this.props.fieldKey.Id === KeyStore.Annotations.Id; } // bcz: ? Why do we need to compare Id's? @action.bound addDocument(doc: Document, allowDuplicates: boolean = false): boolean { let props = this.props; var curPage = props.Document.GetNumber(KeyStore.CurPage, -1); doc.SetOnPrototype(KeyStore.Page, new NumberField(curPage)); + if (this.isAnnotationOverlay) { + doc.SetNumber(KeyStore.Zoom, this.props.Document.GetNumber(KeyStore.Scale, 1)); + } if (curPage >= 0) { doc.SetOnPrototype(KeyStore.AnnotationOn, props.Document); } |
