Sfoglia il codice sorgente

feat: revert contextmenuHandler

DIYgod 3 anni fa
parent
commit
ad4a1a78be
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  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);