diff --git a/src/components/views/context_menus/GenericElementContextMenu.js b/src/components/views/context_menus/GenericElementContextMenu.js index 2959fbbe..0a8d2692 100644 --- a/src/components/views/context_menus/GenericElementContextMenu.js +++ b/src/components/views/context_menus/GenericElementContextMenu.js @@ -24,6 +24,21 @@ export default class GenericElementContextMenu extends React.Component { element: PropTypes.element.isRequired, }; + componentDidMount() { + this.resize = this.resize.bind(this); + window.addEventListener("resize", this.resize.bind(this)); + } + + componentWillUnmount() { + window.removeEventListener("resize", this.resize.bind(this)); + } + + resize() { + if (this.props.onResize) { + this.props.onResize(); + } + } + render() { return