From 28b1ca085e218e0c6644eaa266689082f42d5071 Mon Sep 17 00:00:00 2001 From: Felix Ruponen Date: Tue, 14 Feb 2017 13:19:57 +0100 Subject: [PATCH 1/3] Add ignoreForClass attribute that aborts contextmenu if applied * If the element has the ignoreForClass the context menu won't be shown --- contextMenu.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contextMenu.js b/contextMenu.js index ce7f5e2..60245bf 100644 --- a/contextMenu.js +++ b/contextMenu.js @@ -326,6 +326,11 @@ angular.module('ui.bootstrap.contextMenu', []) return false; } + // Don't show context menu when element has certain class + if(attrs.ignoreForClass && element.hasClass(attrs.ignoreForClass)) { + return false; + } + $scope.$apply(function () { var options = $scope.$eval(attrs.contextMenu); var customClass = attrs.contextMenuClass; From 949f5d4c45047c53145ec612468f2f1068954c61 Mon Sep 17 00:00:00 2001 From: Felix Ruponen Date: Tue, 14 Feb 2017 15:12:57 +0100 Subject: [PATCH 2/3] Add class that makes this dropdown unique --- contextMenu.js | 1 + 1 file changed, 1 insertion(+) diff --git a/contextMenu.js b/contextMenu.js index 60245bf..cfbb2d0 100644 --- a/contextMenu.js +++ b/contextMenu.js @@ -230,6 +230,7 @@ angular.module('ui.bootstrap.contextMenu', []) $(event.currentTarget).addClass('context'); var $ul = $('