aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-07-23 13:25:42 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-07-23 13:25:42 -0500
commit05c46464ba69e889145d8a32320cd7f130665ee1 (patch)
tree4b0e0b070753abb3d37dea2c3ae3ba760ef36a61 /src/client/views/collections/collectionFreeForm
parentf19dfd26aa3232f2fe52ef5e631be208706fca11 (diff)
selection changes
Diffstat (limited to 'src/client/views/collections/collectionFreeForm')
-rw-r--r--src/client/views/collections/collectionFreeForm/PropertiesView.tsx12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/client/views/collections/collectionFreeForm/PropertiesView.tsx b/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
index 5aa0066d2..11609b1c0 100644
--- a/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
+++ b/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
@@ -28,10 +28,14 @@ interface PropertiesViewProps {
export class PropertiesView extends React.Component<PropertiesViewProps> {
@computed get MAX_EMBED_HEIGHT() { return 200; }
- @observable numSelected: number = SelectionManager.SelectedDocuments().length;
- @computed get selectedDocumentView() { return SelectionManager.LastSelection(); }
- @observable selectedDoc: Doc | undefined = this.selectedDocumentView?.props.Document;
- @observable dataDoc: Doc | undefined = this.selectedDocumentView?.props.DataDoc ? this.selectedDocumentView.props.DataDoc : this.selectedDoc;
+
+ @computed get selectedDocumentView() {
+ if (SelectionManger.SelectedDocuments().length) {
+ return SelectionManager.SelectedDocuments()[0];
+ } else { return undefined; }
+ }
+ @computed get selectedDoc() { return this.selectedDocumentView?.props.Document; }
+ @computed get dataDoc() { return this.selectedDocumentView?.props.DataDoc; }
@action
rtfWidth = () => {