Skip to content
Snippets Groups Projects
Commit 2c902a6d authored by srosse's avatar srosse
Browse files

OO-3953: block right click in the drawing interaction

parent 7669fa90
No related branches found
No related tags found
No related merge requests found
......@@ -141,7 +141,7 @@
undo_arr.push(empty_canv); //NEWTHING
jQuery(tmp_canvas).on('mousedown touchstart', function(e) {
if(isDoubleTouch(e)) {
if(isDoubleTouch(e) || isRightClick(e)) {
return;
}
......@@ -476,10 +476,24 @@
}
return false;
}
function isRightClick(e) {
try {
console.log(e);
if(!(typeof e == "undefined")
&& !(typeof e.which == "undefined")
&& (e.which == 2 || e.which == 3)) {
return true;
}
} catch(ex) {
if(window.console) console.log(ex);
}
return false;
}
function onPaint(e) {
if(!(typeof e == "undefined")) {
if(isDoubleTouch(e)) {
if(isDoubleTouch(e) || isRightClick(e)) {
return;
}
e.preventDefault();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment