From 0691dc220f52643f4fd5fa9a29a5c52ef59321aa Mon Sep 17 00:00:00 2001 From: Lauren Choi Date: Fri, 29 Oct 2021 10:30:48 -0400 Subject: toggle properties on selection --- src/client/views/PropertiesView.tsx | 88 +++++++++++++++++++++++++++++++------ 1 file changed, 75 insertions(+), 13 deletions(-) (limited to 'src/client/views/PropertiesView.tsx') diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index ab9022a84..334a44b3b 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -57,6 +57,9 @@ export class PropertiesView extends React.Component { @computed get isPres(): boolean { return this.selectedDoc?.type === DocumentType.PRES; } + @computed get isLink(): boolean { + return this.selectedDoc?.type === DocumentType.LINK; + } @computed get dataDoc() { return this.selectedDoc?.[DataSym]; } @observable layoutFields: boolean = false; @@ -146,8 +149,8 @@ export class PropertiesView extends React.Component { if (key[0] === "#") { rows.push(
{key} -   -
); +   + ); } else { const contentElement = { rows.push(
{key + ":"} -   - {contentElement} +   + {contentElement}
); } } @@ -855,7 +858,7 @@ export class PropertiesView extends React.Component { onPointerDown={action(() => this.openOptions = !this.openOptions)} style={{ backgroundColor: this.openOptions ? "black" : "" }}> Options -
+
@@ -872,7 +875,7 @@ export class PropertiesView extends React.Component { onPointerDown={action(() => this.openSharing = !this.openSharing)} style={{ backgroundColor: this.openSharing ? "black" : "" }}> Sharing {"&"} Permissions -
+
@@ -948,7 +951,7 @@ export class PropertiesView extends React.Component { onPointerDown={action(() => this.openFilters = !this.openFilters)} style={{ backgroundColor: this.openFilters ? "black" : "" }}> Filters -
+
@@ -997,7 +1000,7 @@ export class PropertiesView extends React.Component { onPointerDown={action(() => this.openAppearance = !this.openAppearance)} style={{ backgroundColor: this.openAppearance ? "black" : "" }}> Appearance -
+
@@ -1012,7 +1015,7 @@ export class PropertiesView extends React.Component { onPointerDown={action(() => this.openTransform = !this.openTransform)} style={{ backgroundColor: this.openTransform ? "black" : "" }}> Transform -
+
@@ -1029,7 +1032,7 @@ export class PropertiesView extends React.Component { onPointerDown={action(() => this.openFields = !this.openFields)} style={{ backgroundColor: this.openFields ? "black" : "" }}> Fields {"&"} Tags -
+
@@ -1050,7 +1053,7 @@ export class PropertiesView extends React.Component { onPointerDown={action(() => this.openContexts = !this.openContexts)} style={{ backgroundColor: this.openContexts ? "black" : "" }}> Contexts -
+
@@ -1064,7 +1067,7 @@ export class PropertiesView extends React.Component { onPointerDown={action(() => this.openLayout = !this.openLayout)} style={{ backgroundColor: this.openLayout ? "black" : "" }}> Layout -
+
@@ -1072,6 +1075,14 @@ export class PropertiesView extends React.Component { ; } + toggleAnchor = () => { + this.selectedDoc.anchor = !this.selectedDoc.anchor + } + + toggleArrow = () => { + this.selectedDoc.arrow = !this.selectedDoc.arrow + } + /** @@ -1095,6 +1106,57 @@ export class PropertiesView extends React.Component { ; } else { + if (this.selectedDoc && this.isLink) { + return
+
+ Linking +
+
+ Information +
+

Label

+ +
+
+

Label

+ +
+
+

Description

+ +
+
+
+ Behavior +
+ Follow + +
+
+ Auto-move anchor +
+
+ Auto-move arrow +
+
+
; + } if (this.selectedDoc && !this.isPres) { return
{ onPointerDown={action(() => { this.openPresTransitions = !this.openPresTransitions; })} style={{ backgroundColor: this.openPresTransitions ? "black" : "" }}>     Transitions -
+
-- cgit v1.2.3-70-g09d2