]> git.eli173.com Git - hexmata/commitdiff
rtclick disabled only for canvas now
authorElijah Cohen <eli@eli173.com>
Fri, 1 Apr 2022 12:11:41 +0000 (07:11 -0500)
committerElijah Cohen <eli@eli173.com>
Fri, 1 Apr 2022 12:11:41 +0000 (07:11 -0500)
play.js

diff --git a/play.js b/play.js
index d815d905321f283ed9297793dfc016ef51fd8e29..7ff42971aa8a43d831f8bc4d346c21f39ec66bc7 100644 (file)
--- a/play.js
+++ b/play.js
@@ -44,8 +44,7 @@ function lc() {
                ctx = c.getContext('2d');
                //c.addEventListener('click', e=>getClickCoords(c, 20, 200, 200, e));
                c.addEventListener('click', e=>wwonclick(c,ctx,g,xcenter,ycenter,scale,e));
-               window.oncontextmenu = (e) => {e.preventDefault();}
-               c.oncontextmenu = (e) => wwonrtclick(c,ctx,g,xcenter,ycenter,scale,e)
+               c.oncontextmenu = (e) => {e.preventDefault(); wwonrtclick(c,ctx,g,xcenter,ycenter,scale,e)};
                drawGrid(g, ctx, xcenter,ycenter,scale);
                document.addEventListener('keydown', e=>{
                                if(e.key == "p") pptoggle(e);