From 05c46464ba69e889145d8a32320cd7f130665ee1 Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Thu, 23 Jul 2020 13:25:42 -0500 Subject: selection changes --- .../views/collections/collectionFreeForm/PropertiesView.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/client/views/collections/collectionFreeForm') 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 { @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 = () => { -- cgit v1.2.3-70-g09d2