this code doesn't work. How can I prevent context menu in fabrics?
canvas.on('mouse:up', function(options) {
if(options.target){
switch(options.e.button){
case 0:
// left click
break;
case 2:
// right click
options.e.preventDefault();
break;
}
}
});
答案 0 :(得分:1)
您可以添加:
$('canvas').contextmenu( function() {
return false;
});
在canvas.on('mouse:up'
之外...
请参阅jsFiddle