Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion module/ngContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
* @type {Number}
*/
var KEY_LEFT = 1;

/**
* @constant KEY_RIGHT
* @type {Number}
*/
var KEY_RIGHT = 2;

/**
* @module ngContextMenu
Expand Down Expand Up @@ -80,7 +86,12 @@
// Bind to the `document` if we haven't already.
$document.addEventListener('click', function click(event) {

if (event.which === KEY_LEFT) {
if ((attributes.persistentMenu) && (event.which === KEY_RIGHT)) {
contextMenu.cancelAll();
scope.$apply();
}

if ((!attributes.persistentMenu) && (event.which === KEY_LEFT)) {
contextMenu.cancelAll();
scope.$apply();
}
Expand Down