aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-03 23:14:20 +0800
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-03 23:14:20 +0800
commitf4c14a48f91ec95b900bb1e25452d18971ff21a8 (patch)
tree2d9393c64b7aed3ceae589137945500b3e910146 /src/client/views/collections
parent5717740f9648e0fc44238a3bfb4993cfdb9bc862 (diff)
works with selection manager (PropertiesView)
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/collectionFreeForm/PropertiesView.scss42
-rw-r--r--src/client/views/collections/collectionFreeForm/PropertiesView.tsx21
2 files changed, 36 insertions, 27 deletions
diff --git a/src/client/views/collections/collectionFreeForm/PropertiesView.scss b/src/client/views/collections/collectionFreeForm/PropertiesView.scss
index 6283a6669..2cdaa25ee 100644
--- a/src/client/views/collections/collectionFreeForm/PropertiesView.scss
+++ b/src/client/views/collections/collectionFreeForm/PropertiesView.scss
@@ -543,6 +543,27 @@
}
}
+.propertiesView-presSelected {
+ border-top: solid 1px darkgrey;
+ width: 100%;
+ padding-top: 5px;
+ font-family: Roboto;
+ font-weight: 500;
+ display: inline-flex;
+
+ .propertiesView-selectedList {
+ border-left: solid 1px darkgrey;
+ margin-left: 10px;
+ padding-left: 5px;
+
+ .selectedList-items {
+ font-size: 12;
+ font-weight: 300;
+ margin-top: 1;
+ }
+ }
+}
+
.widthAndDash {
.width {
@@ -617,25 +638,4 @@
margin-top: 2px;
}
}
-
- .propertiesView-presSelected {
- border-top: solid 1px darkgrey;
- width: 100%;
- padding-top: 5px;
- font-family: Roboto;
- font-weight: 500;
- display: inline-flex;
-
- .propertiesView-selectedList {
- border-left: solid 1px darkgrey;
- margin-left: 10px;
- padding-left: 5px;
-
- .selectedList-items {
- font-size: 12;
- font-weight: 300;
- margin-top: 1;
- }
- }
- }
} \ No newline at end of file
diff --git a/src/client/views/collections/collectionFreeForm/PropertiesView.tsx b/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
index ce8baf559..88d585596 100644
--- a/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
+++ b/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
@@ -47,9 +47,14 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
@computed get selectedDocumentView() {
if (SelectionManager.SelectedDocuments().length) {
return SelectionManager.SelectedDocuments()[0];
- } else { console.log(undefined); return undefined; }
+ } else if (PresBox.Instance._selectedArray.length >= 1) {
+ return DocumentManager.Instance.getDocumentView(PresBox.Instance.rootDoc);
+ } else { return undefined; }
+ }
+ @computed get isPres(): boolean {
+ if (this.selectedDoc?.type === DocumentType.PRES) return true;
+ return false;
}
- @computed get isPres() { return this.selectedDoc?.type === DocumentType.PRES }
@computed get selectedDoc() { return this.selectedDocumentView?.rootDoc; }
@computed get dataDoc() { return this.selectedDocumentView?.dataDoc; }
@@ -748,10 +753,14 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
render() {
if (!this.selectedDoc) {
- return <div className="propertiesView" style={{ width: this.props.width }}>
- <div className="propertiesView-title" style={{ width: this.props.width, paddingLeft: 6 }}>
- No Document Selected
- </div> </div>;
+ console.log("!selectedDoc")
+ if (this.isPres === false) {
+ console.log("!isPres")
+ return <div className="propertiesView" style={{ width: this.props.width }}>
+ <div className="propertiesView-title" style={{ width: this.props.width, paddingLeft: 6 }}>
+ No Document Selected
+ </div> </div>;
+ }
}
const novice = Doc.UserDoc().noviceMode;