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...

19 lines
530 B

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