From fcf44ede1de94778048b8efa14e20fa265c9408d Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 7 Sep 2023 17:04:26 -0400 Subject: another popup fix --- src/client/views/collections/TabDocView.tsx | 91 ++++++++++++++--------------- 1 file changed, 44 insertions(+), 47 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx index e963e2f52..0044a2832 100644 --- a/src/client/views/collections/TabDocView.tsx +++ b/src/client/views/collections/TabDocView.tsx @@ -33,6 +33,7 @@ import { CollectionFreeFormView } from './collectionFreeForm/CollectionFreeFormV import { CollectionView } from './CollectionView'; import './TabDocView.scss'; import React = require('react'); +import { SettingsManager } from '../../util/SettingsManager'; const _global = (window /* browser */ || global) /* node */ as any; interface TabDocViewProps { @@ -567,60 +568,56 @@ export class TabMinimapView extends React.Component { emptyFunction ); }; - render() { - if (!this.renderBounds) return null; + popup = () => { + if (!this.renderBounds) return <>; const miniWidth = (this.props.PanelWidth() / NumCast(this.props.document._freeform_scale, 1) / this.renderBounds.dim) * 100; const miniHeight = (this.props.PanelHeight() / NumCast(this.props.document._freeform_scale, 1) / this.renderBounds.dim) * 100; const miniLeft = 50 + ((NumCast(this.props.document._freeform_panX) - this.renderBounds.cx) / this.renderBounds.dim) * 100 - miniWidth / 2; const miniTop = 50 + ((NumCast(this.props.document._freeform_panY) - this.renderBounds.cy) / this.renderBounds.dim) * 100 - miniHeight / 2; const miniSize = this.returnMiniSize(); return ( -
- } - color={StrCast(Doc.UserDoc().userVariantColor, Colors.MEDIUM_BLUE)} - type={Type.TERT} - onPointerDown={e => e.stopPropagation()} - placement={'top-end'} - popup={ -
- -
-
-
-
- } +
+ +
+
+
+
+ ); + }; + render() { + return ( +
+ } color={SettingsManager.userVariantColor} type={Type.TERT} onPointerDown={e => e.stopPropagation()} placement={'top-end'} popup={this.popup} />
); } -- cgit v1.2.3-70-g09d2