|
1 | 1 | import { debounce, find, get, some, isArray } from "lodash-es"; |
2 | 2 | // import sizeMe from "react-sizeme"; |
3 | 3 | import { showContextMenu } from "@teselagen/ui"; |
4 | | -import { |
5 | | - Button, |
6 | | - ButtonGroup, |
7 | | - Intent, |
8 | | - Icon, |
9 | | - Tooltip, |
10 | | - ContextMenu |
11 | | -} from "@blueprintjs/core"; |
| 4 | +import { Button, ButtonGroup, Intent, Icon, Tooltip } from "@blueprintjs/core"; |
12 | 5 | import PropTypes from "prop-types"; |
13 | 6 |
|
14 | 7 | import VersionHistoryView from "../VersionHistoryView"; |
@@ -54,6 +47,7 @@ import isMobile from "is-mobile"; |
54 | 47 | import { getClientX, getClientY } from "../utils/editorUtils"; |
55 | 48 | import PCRTool from "../PCRTool/PCRTool"; |
56 | 49 | import classNames from "classnames"; |
| 50 | +import * as Popover2 from "@blueprintjs/popover2"; |
57 | 51 |
|
58 | 52 | // if (process.env.NODE_ENV !== 'production') { |
59 | 53 | // const {whyDidYouUpdate} = require('why-did-you-update'); |
@@ -304,9 +298,12 @@ export class Editor extends React.Component { |
304 | 298 | const { previewModeButtonMenu } = this.props; |
305 | 299 | event.preventDefault(); |
306 | 300 | if (previewModeButtonMenu) { |
307 | | - ContextMenu.show(previewModeButtonMenu, { |
308 | | - left: getClientX(event), |
309 | | - top: getClientY(event) |
| 301 | + Popover2.showContextMenu({ |
| 302 | + content: previewModeButtonMenu, |
| 303 | + targetOffset: { |
| 304 | + left: getClientX(event), |
| 305 | + top: getClientY(event) |
| 306 | + } |
310 | 307 | }); |
311 | 308 | } |
312 | 309 | }; |
|
0 commit comments