Skip to content

Commit

Permalink
Merge pull request Templarian#13 from SuricateCan/master
Browse files Browse the repository at this point in the history
Prevent right click propagation.
  • Loading branch information
Templarian committed Jun 7, 2015
2 parents 98bc49e + 69dcd50 commit 3841e31
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ angular.module('ui.bootstrap.contextMenu', [])
} else {
var $a = $('<a>');
$a.attr({ tabindex: '-1', href: '#' });
var text = typeof item[0] == 'string' ? item[0] : item[0].call($scope, $scope, event);
var text = typeof item[0] == 'string' ? item[0] : item[0].call($scope, $scope, event, model);
$a.text(text);
$li.append($a);
var enabled = angular.isDefined(item[2]) ? item[2].call($scope, $scope, event, text, model) : true;
Expand Down Expand Up @@ -72,6 +72,7 @@ angular.module('ui.bootstrap.contextMenu', [])
};
return function ($scope, element, attrs) {
element.on('contextmenu', function (event) {
event.stopPropagation();
$scope.$apply(function () {
event.preventDefault();
var options = $scope.$eval(attrs.contextMenu);
Expand Down

0 comments on commit 3841e31

Please sign in to comment.