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