From e0757ecfe8666a13a38b1c396d4a9e5138b4a3bd Mon Sep 17 00:00:00 2001 From: eperelm2 Date: Thu, 22 Jun 2023 11:26:24 -0400 Subject: double clicking works --- src/client/views/PropertiesView.tsx | 196 ++++++++++++++++++++++++++++++++---- 1 file changed, 176 insertions(+), 20 deletions(-) (limited to 'src/client/views/PropertiesView.tsx') diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index a0c45bc70..60e93cdfd 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -1050,11 +1050,34 @@ export class PropertiesView extends React.Component { } @computed get optionsSubMenu() { + let isDouble = false; + return (
(this.inOptions = true))} onPointerLeave={action(() => (this.inOptions = false))}> -
(this.openContexts = false, this.openLinks = false, this.openTransform = false, - this.openFields = false, this.openSharing = false, this.openFilters = false, this.openLayout = false))} - onClick={action(() => (this.openOptions = !this.openOptions))} style={{ backgroundColor: this.openOptions ? 'black' : '' }}> +
{ + if (!isDouble){ + this.openOptions = !this.openOptions + } } )} + onDoubleClick={action(() => { + isDouble = true; + + this.openContexts = false; + this.openLinks = false; + this.openOptions = true; + this.openTransform = false; + this.openFields = false; + this.openSharing = false; + this.openLayout = false; + this.openFilters = false; + + + setTimeout(() => { + isDouble = false; + }, 300) + } + + )} + style={{ backgroundColor: this.openOptions ? 'black' : '' }}> Options
@@ -1070,11 +1093,32 @@ export class PropertiesView extends React.Component { } @computed get sharingSubMenu() { + let isDouble:boolean = false; + return (
-
(this.openContexts = false, this.openLinks = false, this.openTransform = false, - this.openOptions = false, this.openFields = false, this.openFilters = false, this.openLayout))} - onClick={action(() => (this.openSharing = !this.openSharing))} style={{ backgroundColor: this.openSharing ? 'black' : '' }}> +
{ + if (!isDouble){ + this.openSharing = !this.openSharing + } } )} + onDoubleClick={action(() => { + isDouble = true; + + this.openContexts = false; + this.openLinks = false; + this.openOptions = false; + this.openTransform = false; + this.openFields = false; + this.openSharing = true; + this.openLayout = false; + this.openFilters = false; + + + setTimeout(() => { + isDouble = false; + }, 300) + })} + style={{ backgroundColor: this.openSharing ? 'black' : '' }}> Sharing {'&'} Permissions
@@ -1127,11 +1171,34 @@ export class PropertiesView extends React.Component { }; @computed get filtersSubMenu() { + let isDouble: boolean = false; + return (
-
(this.openContexts = false, this.openLinks = false, this.openTransform = false, - this.openOptions = false, this.openFields = false, this.openSharing = false, this.openLayout = false))} - onClick={action(() => (this.openFilters = !this.openFilters))} style={{ backgroundColor: this.openFilters ? 'black' : '' }}> +
{ + if (!isDouble){ + this.openFilters = !this.openFilters + } } )} + onDoubleClick={action(() => { + isDouble = true; + + this.openContexts = false; + this.openLinks = false; + this.openOptions = false; + this.openTransform = false; + this.openFields = false; + this.openSharing = false; + this.openLayout = false; + this.openFilters = true; + + + setTimeout(() => { + isDouble = false; + }, 300) + } + + )} + style={{ backgroundColor: this.openFilters ? 'black' : '' }}> Filters
@@ -1147,6 +1214,8 @@ export class PropertiesView extends React.Component { } @computed get inkSubMenu() { + let isDouble = false; + return ( <> {!this.isInk ? null : ( @@ -1162,8 +1231,27 @@ export class PropertiesView extends React.Component { )}
-
(this.openTransform = !this.openTransform))} onDoubleClick={action(() => (this.openContexts = false, this.openLinks = false, this.openOptions = false, - this.openFields = false, this.openSharing = false, this.openFilters = false, this.openLayout = false, this.openTransform = true))} +
{ + if (!isDouble){ + this.openTransform = !this.openTransform + } } )} + onDoubleClick={action(() => { + isDouble = true; + + this.openContexts = false; + this.openLinks = false; + this.openOptions = false; + this.openTransform = true; + this.openFields = false; + this.openSharing = false; + this.openLayout = false; + this.openFilters = false; + + + setTimeout(() => { + isDouble = false; + }, 300) + })} style={{ backgroundColor: this.openTransform ? 'black' : '' }}> Transform
@@ -1177,11 +1265,34 @@ export class PropertiesView extends React.Component { } @computed get fieldsSubMenu() { + let isDouble: boolean = false; + return (
-
(this.openContexts = false, this.openLinks = false, this.openTransform = false, - this.openOptions = false, this.openSharing = false, this.openFilters = false, this.openLayout = false))} - onClick={action(() => (this.openFields = !this.openFields))} style={{ backgroundColor: this.openFields ? 'black' : '' }}> +
{ + if (!isDouble){ + this.openFields = !this.openFields + } } )} + onDoubleClick={action(() => { + isDouble = true; + + this.openContexts = false; + this.openLinks = false; + this.openOptions = false; + this.openTransform = false; + this.openFields = true; + this.openSharing = false; + this.openLayout = false; + this.openFilters = false; + + + setTimeout(() => { + isDouble = false; + }, 300) + } + + )} + style={{ backgroundColor: this.openFields ? 'black' : '' }}> Fields {'&'} Tags
@@ -1199,11 +1310,33 @@ export class PropertiesView extends React.Component { } @computed get contextsSubMenu() { + let isDouble = false; return (
-
(this.openLinks = false, this.openTransform = false, this.openOptions = false, this.openFields = false, - this.openSharing = false, this.openFilters = false, this.openLayout = false ))} - onClick ={action(() => (this.openContexts = !this.openContexts))} style={{ backgroundColor: this.openContexts ? 'black' : '' }}> +
{ + if (!isDouble){ + this.openContexts = !this.openContexts + } } )} + onDoubleClick={action(() => { + isDouble = true; + + this.openContexts = true; + this.openLinks = false; + this.openOptions = false; + this.openTransform = false; + this.openFields = false; + this.openSharing = false; + this.openLayout = false; + this.openFilters = false; + + + setTimeout(() => { + isDouble = false; + }, 300) + } + + )} + style={{ backgroundColor: this.openContexts ? 'black' : '' }}> Other Contexts
@@ -1260,11 +1393,34 @@ export class PropertiesView extends React.Component { } @computed get layoutSubMenu() { + let isDouble: boolean = false; + return (
-
(this.openContexts = false, this.openLinks = false, this.openTransform = false, - this.openOptions = false, this.openFields = false, this.openSharing = false, this.openFilters = false ))} - onClick={action(() => (this.openLayout = !this.openLayout))} style={{ backgroundColor: this.openLayout ? 'black' : '' }}> +
{ + if (!isDouble){ + this.openLayout = !this.openLayout + } } )} + onDoubleClick={action(() => { + isDouble = true; + + this.openContexts = false; + this.openLinks = false; + this.openOptions = false; + this.openTransform = false; + this.openFields = false; + this.openSharing = false; + this.openLayout = true; + this.openFilters = false; + + + setTimeout(() => { + isDouble = false; + }, 300) + } + + )} + style={{ backgroundColor: this.openLayout ? 'black' : '' }}> Layout
-- cgit v1.2.3-70-g09d2