Browse Source

feat: revert contextmenuHandler

DIYgod 2 years ago
parent
commit
ad4a1a78be
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/js/contextmenu.js

+ 3 - 3
src/js/contextmenu.js

@@ -13,14 +13,14 @@ class ContextMenu {
         });
 
         this.contextmenuHandler = (e) => {
-            const event = e || window.event;
-            event.preventDefault();
-
             if (this.shown) {
                 this.hide();
                 return;
             }
 
+            const event = e || window.event;
+            event.preventDefault();
+
             const clientRect = this.player.container.getBoundingClientRect();
             this.show(event.clientX - clientRect.left, event.clientY - clientRect.top);