diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/ParentDocumentSelector.scss | 3 | ||||
-rw-r--r-- | src/client/views/collections/ParentDocumentSelector.tsx | 34 |
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>; } } |