OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/assets/javascripts/angular/directives/components/accessible-by-keyboard-dire...

15 lines
481 B

angular.module('openproject.uiComponents')
.directive('accessibleByKeyboard', [function() {
return {
restrict: 'E',
transclude: true,
scope: { execute: '&' },
template: "<a execute-on-enter='execute()' default-event-handling='defaultEventHandling' ng-click='execute()' href=''>" +
"<span ng-transclude></span>" +
"</a>",
link: function(scope, element, attrs) {
scope.defaultEventHandling = !attrs.execute;
}
};
}]);