Fix contextmenu right click (active only above drawing canvas)

This commit is contained in:
Vince 2013-06-14 13:18:26 +02:00
parent 0bb097e54b
commit 92561db1c6

View File

@ -71,7 +71,7 @@
body.mouseup($.proxy(this.onMouseup_, this));
// Deactivate right click:
//body.contextmenu(this.onCanvasContextMenu_);
body.contextmenu(this.onCanvasContextMenu_);
};
@ -217,10 +217,13 @@
* @private
*/
ns.DrawingController.prototype.onCanvasContextMenu_ = function (event) {
event.preventDefault();
event.stopPropagation();
event.cancelBubble = true;
return false;
if ($(event.target).closest('#drawing-canvas-container').length) {
// Deactivate right click on drawing canvas only.
event.preventDefault();
event.stopPropagation();
event.cancelBubble = true;
return false;
}
};
ns.DrawingController.prototype.render = function () {