11import cls from "classnames" ;
2- import ContextMenuItem from "./ContextMenuItem " ;
3- import PureComponent from "../lib/PureComponent " ;
4- import { store } from "../store " ;
5- import { elementIsOutside } from "../utils " ;
2+ import PureComponent from "../lib/PureComponent.jsx " ;
3+ import { store } from "../store.js " ;
4+ import { elementIsOutside } from "../utils.js " ;
5+ import ContextMenuItem from "./ContextMenuItem.jsx " ;
66
7- import * as s from "./ContextMenu.css" ;
7+ import * as styles from "./ContextMenu.css" ;
88
99export default class ContextMenu extends PureComponent {
1010 componentDidMount ( ) {
@@ -30,8 +30,8 @@ export default class ContextMenu extends PureComponent {
3030 render ( ) {
3131 const { visible } = this . props ;
3232 const containerClassName = cls ( {
33- [ s . container ] : true ,
34- [ s . hidden ] : ! visible ,
33+ [ styles . container ] : true ,
34+ [ styles . hidden ] : ! visible ,
3535 } ) ;
3636 const multipleChunksSelected = store . selectedChunks . length > 1 ;
3737 return (
@@ -93,14 +93,14 @@ export default class ContextMenu extends PureComponent {
9393 /**
9494 * Handle document-wide `mousedown` events to detect clicks
9595 * outside the context menu.
96- * @param {MouseEvent } e - DOM mouse event object
96+ * @param {MouseEvent } event - DOM mouse event object
9797 * @returns {void }
9898 */
99- handleDocumentMousedown = ( e ) => {
100- const isSecondaryClick = e . ctrlKey || e . button === 2 ;
101- if ( ! isSecondaryClick && elementIsOutside ( e . target , this . node ) ) {
102- e . preventDefault ( ) ;
103- e . stopPropagation ( ) ;
99+ handleDocumentMousedown = ( event ) => {
100+ const isSecondaryClick = event . ctrlKey || event . button === 2 ;
101+ if ( ! isSecondaryClick && elementIsOutside ( event . target , this . node ) ) {
102+ event . preventDefault ( ) ;
103+ event . stopPropagation ( ) ;
104104 this . hide ( ) ;
105105 }
106106 } ;
0 commit comments