aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PropertiesView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/PropertiesView.tsx')
-rw-r--r--src/client/views/PropertiesView.tsx39
1 files changed, 19 insertions, 20 deletions
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index 72ff906f6..9cc75b1c6 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -52,6 +52,12 @@ interface PropertiesViewProps {
export class PropertiesView extends React.Component<PropertiesViewProps> {
private _widthUndo?: UndoManager.Batch;
+ public static Instance: PropertiesView | undefined;
+ constructor(props: any) {
+ super(props);
+ PropertiesView.Instance = this;
+ }
+
@computed get MAX_EMBED_HEIGHT() {
return 200;
}
@@ -75,6 +81,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
}
@observable layoutFields: boolean = false;
+ @observable layoutDocAcls: boolean = false;
@observable openOptions: boolean = true;
@observable openSharing: boolean = true;
@@ -86,8 +93,6 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
@observable openTransform: boolean = true;
@observable openFilters: boolean = false;
- @observable layoutDocAcls: boolean = false;
-
//Pres Trails booleans:
@observable openPresTransitions: boolean = true;
@observable openPresProgressivize: boolean = false;
@@ -103,7 +108,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
this._disposers.link = reaction(
() => LinkManager.currentLink,
link => {
- link && this.onDoubleClick();
+ link && this.CloseAll();
link && (this.openLinks = true);
},
{ fireImmediately: true }
@@ -970,7 +975,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
};
@action
- onDoubleClick = () => {
+ CloseAll = () => {
this.openContexts = false;
this.openLinks = false;
this.openOptions = false;
@@ -1120,7 +1125,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
isOpen={this.openOptions}
setInSection={bool => (this.inOptions = bool)}
setIsOpen={bool => (this.openOptions = bool)}
- onDoubleClick={this.onDoubleClick}
+ onDoubleClick={this.CloseAll}
/>
);
}
@@ -1147,7 +1152,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
}
isOpen={this.openSharing}
setIsOpen={bool => (this.openSharing = bool)}
- onDoubleClick={() => this.onDoubleClick()}
+ onDoubleClick={() => this.CloseAll()}
/>
);
}
@@ -1187,7 +1192,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
}
isOpen={this.openFilters}
setIsOpen={bool => (this.openFilters = bool)}
- onDoubleClick={() => this.onDoubleClick()}
+ onDoubleClick={() => this.CloseAll()}
/>
);
}
@@ -1197,8 +1202,8 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
return (
<>
- <PropertiesSection title="Appearance" content={this.isInk ? this.appearanceEditor : null} isOpen={this.openAppearance} setIsOpen={bool => (this.openAppearance = bool)} onDoubleClick={() => this.onDoubleClick()} />
- <PropertiesSection title="Transform" content={this.transformEditor} isOpen={this.openTransform} setIsOpen={bool => (this.openTransform = bool)} onDoubleClick={() => this.onDoubleClick()} />
+ <PropertiesSection title="Appearance" content={this.isInk ? this.appearanceEditor : null} isOpen={this.openAppearance} setIsOpen={bool => (this.openAppearance = bool)} onDoubleClick={() => this.CloseAll()} />
+ <PropertiesSection title="Transform" content={this.transformEditor} isOpen={this.openTransform} setIsOpen={bool => (this.openTransform = bool)} onDoubleClick={() => this.CloseAll()} />
</>
);
}
@@ -1210,29 +1215,23 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
content={<div className="propertiesView-content fields">{Doc.noviceMode ? this.noviceFields : this.expandedField}</div>}
isOpen={this.openFields}
setIsOpen={bool => (this.openFields = bool)}
- onDoubleClick={() => this.onDoubleClick()}
+ onDoubleClick={() => this.CloseAll()}
/>
);
}
@computed get contextsSubMenu() {
return (
- <PropertiesSection
- title="Other Contexts"
- content={this.contextCount > 0 ? this.contexts : 'There are no other contexts.'}
- isOpen={this.openContexts}
- setIsOpen={bool => (this.openContexts = bool)}
- onDoubleClick={() => this.onDoubleClick()}
- />
+ <PropertiesSection title="Other Contexts" content={this.contextCount > 0 ? this.contexts : 'There are no other contexts.'} isOpen={this.openContexts} setIsOpen={bool => (this.openContexts = bool)} onDoubleClick={() => this.CloseAll()} />
);
}
@computed get linksSubMenu() {
- return <PropertiesSection title="Linked To" content={this.linkCount > 0 ? this.links : 'There are no current links.'} isOpen={this.openLinks} setIsOpen={bool => (this.openLinks = bool)} onDoubleClick={this.onDoubleClick} />;
+ return <PropertiesSection title="Linked To" content={this.linkCount > 0 ? this.links : 'There are no current links.'} isOpen={this.openLinks} setIsOpen={bool => (this.openLinks = bool)} onDoubleClick={this.CloseAll} />;
}
@computed get layoutSubMenu() {
- return <PropertiesSection title="Layout" content={this.layoutPreview} isOpen={this.openLayout} setIsOpen={bool => (this.openLayout = bool)} onDoubleClick={this.onDoubleClick} />;
+ return <PropertiesSection title="Layout" content={this.layoutPreview} isOpen={this.openLayout} setIsOpen={bool => (this.openLayout = bool)} onDoubleClick={this.CloseAll} />;
}
@computed get description() {
@@ -1723,7 +1722,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
{this.contextsSubMenu}
{this.fieldsSubMenu}
{isNovice ? null : this.sharingSubMenu}
- {isNovice ? null : this.filtersSubMenu}
+ {this.filtersSubMenu}
{isNovice ? null : this.layoutSubMenu}
</div>
);