Ver código fonte

feat: revert contextmenuHandler

DIYgod 3 anos atrás
pai
commit
ad4a1a78be
1 arquivos alterados com 3 adições e 3 exclusões
  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);