aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-12-16 10:37:14 -0500
committerbob <bcz@cs.brown.edu>2019-12-16 10:37:14 -0500
commit7584c5bed0de45f2f656fb289ff67463fb1958ef (patch)
tree04849c69cc45d322a304b80859f84d6b1aeba196 /src
parent9a90830162cf176b58729385588accf3b589454d (diff)
fixed docbutton flyout from docking menu
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/ParentDocumentSelector.scss3
-rw-r--r--src/client/views/collections/ParentDocumentSelector.tsx34
2 files changed, 22 insertions, 15 deletions
diff --git a/src/client/views/collections/ParentDocumentSelector.scss b/src/client/views/collections/ParentDocumentSelector.scss
index 20e7cb994..d293bb5ca 100644
--- a/src/client/views/collections/ParentDocumentSelector.scss
+++ b/src/client/views/collections/ParentDocumentSelector.scss
@@ -45,6 +45,9 @@
display: inline-block;
}
.buttonSelector {
+ div {
+ overflow: visible !important;
+ }
position: absolute;
display: inline-block;
padding-left: 5px;
diff --git a/src/client/views/collections/ParentDocumentSelector.tsx b/src/client/views/collections/ParentDocumentSelector.tsx
index 5208f65c4..e00d8e83b 100644
--- a/src/client/views/collections/ParentDocumentSelector.tsx
+++ b/src/client/views/collections/ParentDocumentSelector.tsx
@@ -106,23 +106,27 @@ export class ButtonSelector extends React.Component<{ Document: Doc, Stack: any
this.hover = !this.hover;
e.stopPropagation();
}
+ customStylesheet(styles: any) {
+ return {
+ ...styles,
+ panel: {
+ ...styles.panel,
+ minWidth: "100px"
+ },
+ };
+ }
render() {
- let flyout;
- if (this.hover) {
- const view = DocumentManager.Instance.getDocumentView(this.props.Document);
- flyout = !view ? (null) : (
- <div className="ParentDocumentSelector-flyout" title=" ">
- <DocumentButtonBar views={[view]} stack={this.props.Stack} />
- </div>
- );
- }
- return (
- <span className="buttonSelector"
- onPointerDown={this.onPointerDown}>
- {this.hover ? (null) : <FontAwesomeIcon icon={faEdit} size={"sm"} />}
- {flyout}
- </span>
+ const view = DocumentManager.Instance.getDocumentView(this.props.Document);
+ let flyout = (
+ <div className="ParentDocumentSelector-flyout" title=" ">
+ <DocumentButtonBar views={[view!]} stack={this.props.Stack} />
+ </div>
);
+ return <span title="Tap for menu" onPointerDown={e => e.stopPropagation()} className="buttonSelector">
+ <Flyout anchorPoint={anchorPoints.RIGHT_TOP} content={flyout} stylesheet={this.customStylesheet}>
+ <FontAwesomeIcon icon={faEdit} size={"sm"} />
+ </Flyout>
+ </span>;
}
}