aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-08-03 10:19:39 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-08-03 10:19:39 -0500
commitf4940b063a512e15723d62671b8e11619b1bfcd7 (patch)
tree63c51b5c3e6660279d516217f09c749502231c4d
parent8d1f4cdf924a4002f132886230eb85a40dfcae3f (diff)
fix double click on left pane
-rw-r--r--src/client/util/CurrentUserUtils.ts1
-rw-r--r--src/client/views/PropertiesButtons.tsx20
-rw-r--r--src/client/views/collections/CollectionDockingView.scss2
-rw-r--r--src/client/views/collections/ParentDocumentSelector.scss15
-rw-r--r--src/client/views/nodes/FontIconBox.tsx3
5 files changed, 34 insertions, 7 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index c27290e74..3aa13d535 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -531,6 +531,7 @@ export class CurrentUserUtils {
stayInCollection: true,
_width: 60,
_height: 60,
+ onDoubleClick: ScriptField.MakeScript('console.log("hi")', { scriptContext: "any" }),
onClick: ScriptField.MakeScript(click, { scriptContext: "any" }),
}));
diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx
index 68969b413..d46c03470 100644
--- a/src/client/views/PropertiesButtons.tsx
+++ b/src/client/views/PropertiesButtons.tsx
@@ -550,6 +550,23 @@ export class PropertiesButtons extends React.Component<{}, {}> {
</Tooltip>;
}
+ @computed
+ get contextButton() {
+ if (this.selectedDoc) {
+ return <Tooltip title={<><div className="dash-tooltip">Show Context</div></>}>
+ <div className={"propertiesButtons-linkButton-empty"}>
+ <ParentDocSelector Document={this.selectedDoc} addDocTab={(doc, where) => {
+ where === "onRight" ? CollectionDockingView.AddRightSplit(doc) :
+ this.selectedDocumentView?.props.addDocTab(doc, "onRight");
+ return true;
+ }} />
+ </div>
+ </Tooltip>;
+ } else {
+ return false;
+ }
+
+ }
// @computed
// get importButton() {
@@ -605,6 +622,9 @@ export class PropertiesButtons extends React.Component<{}, {}> {
<div className="propertiesButtons-button">
{this.onClickButton}
</div>
+ {/* <div className="propertiesButtons-button">
+ {this.contextButton}
+ </div> */}
<div className="propertiesButtons-button">
{this.sharingButton}
</div>
diff --git a/src/client/views/collections/CollectionDockingView.scss b/src/client/views/collections/CollectionDockingView.scss
index 27d66f796..4ec1c51cf 100644
--- a/src/client/views/collections/CollectionDockingView.scss
+++ b/src/client/views/collections/CollectionDockingView.scss
@@ -86,8 +86,6 @@
width: 18px;
display: inline-block;
margin: auto;
-
- display: none;
}
.collectionDockingView-dragAsDocument {
diff --git a/src/client/views/collections/ParentDocumentSelector.scss b/src/client/views/collections/ParentDocumentSelector.scss
index 4e704b58f..bc9cf4848 100644
--- a/src/client/views/collections/ParentDocumentSelector.scss
+++ b/src/client/views/collections/ParentDocumentSelector.scss
@@ -2,11 +2,13 @@
div {
overflow: visible !important;
}
+
.metadataEntry-outerDiv {
overflow: hidden !important;
pointer-events: all;
}
}
+
.parentDocumentSelector-flyout {
position: relative;
z-index: 9999;
@@ -31,26 +33,31 @@
border-left: 0px;
}
}
+
.parentDocumentSelector-button {
- pointer-events: all;
+ pointer-events: all;
position: relative;
display: inline-block;
+
svg {
- width:20px !important;
- height:20px;
+ // width:20px !important;
+ //height:20px;
}
}
+
.parentDocumentSelector-metadata {
pointer-events: auto;
padding-right: 5px;
width: 25px;
display: inline-block;
}
+
.buttonSelector {
div {
overflow: visible !important;
}
- display: inline-block;
+
+ display: inline-block;
width:100%;
height:100%;
} \ No newline at end of file
diff --git a/src/client/views/nodes/FontIconBox.tsx b/src/client/views/nodes/FontIconBox.tsx
index 7c538df92..48f9d7cc6 100644
--- a/src/client/views/nodes/FontIconBox.tsx
+++ b/src/client/views/nodes/FontIconBox.tsx
@@ -6,7 +6,7 @@ import { DocComponent } from '../DocComponent';
import './FontIconBox.scss';
import { FieldView, FieldViewProps } from './FieldView';
import { StrCast, Cast, NumCast } from '../../../fields/Types';
-import { Utils } from "../../../Utils";
+import { Utils, emptyFunction } from "../../../Utils";
import { runInAction, observable, reaction, IReactionDisposer } from 'mobx';
import { Doc } from '../../../fields/Doc';
import { ContextMenu } from '../ContextMenu';
@@ -75,6 +75,7 @@ export class FontIconBox extends DocComponent<FieldViewProps, FontIconDocument>(
const color = CurrentUserUtils.selectedPanel === this.dataDoc.title ? "black" : "white";
const menuBTN = <div className="menuButton"
+ onDoubleClick={emptyFunction}
style={{ backgroundColor: CurrentUserUtils.selectedPanel === this.dataDoc.title ? "lightgrey" : "" }}>
<div className="menuButton-wrap"