فهرست منبع

Fix contextmenu handler in JS (#1014)

Aksel 3 سال پیش
والد
کامیت
7c8ea60529
1فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 5 3
      hxd/Window.js.hx

+ 5 - 3
hxd/Window.js.hx

@@ -97,11 +97,13 @@ class Window {
 
 		js.Browser.window.addEventListener("resize", checkResize);
 
-		canvas.oncontextmenu = function(e){
+		canvas.addEventListener("contextmenu", function(e){
 			e.stopPropagation();
-			e.preventDefault();
+			if (e.button == 2) {
+				e.preventDefault();
+			}
 			return false;
-		};
+		});
 		if( globalEvents ) {
 			// make first mousedown on canvas trigger event
 			canvas.addEventListener("mousedown", function(e) {