Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
[% l('Actions') %] <span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right">
- <li ng-repeat="action in actions" ng-class="{divider: action.divider}">
+ <li ng-repeat="action in actions" ng-class="{divider: action.divider}" ng-hide="actionHide(action)">
<a ng-if="!action.divider" href
ng-click="actionLauncher(action)">{{action.label}}</a>
</li>
return ''+item;
}
+ // fires the hide handler function for a context action
+ $scope.actionHide = function(action) {
+ if (!action.hide) {
+ return false;
+ }
+ return action.hide(action);
+ }
+
// fires the action handler function for a context action
$scope.actionLauncher = function(action) {
if (!action.handler) {
scope : {
label : '@', // Action label
handler : '=', // Action function handler
+ hide : '=',
divider : '='
},
link : function(scope, element, attrs, egGridCtrl) {
egGridCtrl.addAction({
+ hide : scope.hide,
label : scope.label,
divider : scope.divider,
handler : scope.handler