diff --git a/modules/ui/components/AdjustableAbs.jsx b/modules/ui/components/AdjustableAbs.jsx
index e4876207..d09e1e8b 100644
--- a/modules/ui/components/AdjustableAbs.jsx
+++ b/modules/ui/components/AdjustableAbs.jsx
@@ -13,9 +13,9 @@ export class Adjuster extends React.Component {
if (!this.el) {
return;
}
- let w = this.el.offsetWidth;
- let h = this.el.offsetHeight;
- let holder = this.el.parentNode;
+ let w = this.el.clientWidth;
+ let h = this.el.clientHeight;
+ let holder = document.documentElement;
const fit = (prop, pos, dim, holderDim) => {
if (pos !== undefined) {
@@ -43,10 +43,10 @@ export class Adjuster extends React.Component {
}
}
- fit('left', left, w, holder.offsetWidth);
- fit('right', right,w, holder.offsetWidth);
- fit('top', top, h, holder.offsetHeight);
- fit('bottom', bottom, h, holder.offsetHeight);
+ fit('left', left, w, holder.clientWidth);
+ fit('right', right,w, holder.clientWidth);
+ fit('top', top, h, holder.clientHeight);
+ fit('bottom', bottom, h, holder.clientHeight);
this.el.style.visibility = 'visible';
};
@@ -63,7 +63,7 @@ export class Adjuster extends React.Component {
return
this.el = el}
style={{
visibility: 'hidden',
- position: 'absolute', zIndex,
+ position: 'fixed', zIndex,
...style}} {...props}>
{children}
;
diff --git a/modules/ui/components/Folder.jsx b/modules/ui/components/Folder.jsx
index 1b825779..2b595bf0 100644
--- a/modules/ui/components/Folder.jsx
+++ b/modules/ui/components/Folder.jsx
@@ -26,15 +26,15 @@ export default class Folder extends React.Component{
render() {
let {title, closable, className, children} = this.props;
return
-
+ {title}
{!this.isClosed() && children}
}
}
-export function Title({title, isClosed, onClick}) {
+export function Title({children, isClosed, onClick}) {
return
- {' '}{title}
+ {' '}{children}
;
}
diff --git a/modules/ui/components/Menu.jsx b/modules/ui/components/Menu.jsx
index 04b5bd01..092b96b2 100644
--- a/modules/ui/components/Menu.jsx
+++ b/modules/ui/components/Menu.jsx
@@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
import ls from './Menu.less';
import AuxWidget from "./AuxWidget";
import cx from 'classnames';
+import Fa from './Fa';
export default function Menu({children, x, y, orientationUp, centered, menuId, ...props}) {
return ;
}
+export class ContextMenu extends React.Component {
+
+ state = {
+ active: false
+ };
+
+ onClick = e => {
+ e.preventDefault();
+ this.setState({
+ active: true,
+ x: e.clientX,
+ y: e.clientY
+ });
+ };
+
+ close = () => {
+ this.setState({active: false})
+ };
+
+ componentDidMount() {
+ this.detacher = this.context.onCloseAll.attach(this.close);
+ }
+
+ componentWillUnmount() {
+ this.detacher();
+ }
+
+ render() {
+ return
+ {this.props.children}
+
+ {this.state.active && }
+
+ }
+
+ getChildContext() {
+ return {
+ closeMenu: this.close
+ };
+ }
+
+ static contextTypes = {
+ onCloseAll: PropTypes.object
+ };
+
+ static childContextTypes = {
+ closeMenu: PropTypes.func
+ };
+}
+
+export function ContextMenuItem({onClick, ...props}, {closeMenu}) {
+ return