Refactor empty element directive

pull/1845/head
Hagen Schink 10 years ago
parent 52a9bbf71a
commit 7d4414850d
  1. 12
      app/assets/javascripts/angular/directives/components/accessible-element-directive.js
  2. 4
      public/templates/components/accessible_element.html
  3. 6
      public/templates/components/empty_element.html

@ -0,0 +1,12 @@
angular.module('openproject.uiComponents')
.directive('accessibleElement', [function() {
return {
restrict: 'E',
scope: {
visibleText: '=',
readableText: '=',
},
templateUrl: "/templates/components/accessible_element.html"
};
}]);

@ -0,0 +1,4 @@
<span>
<span aria-hidden="true" role="presentation" tabindex="-1" ng-bind="visibleText"></span>
<span class="hidden-for-sighted" ng-bind="readableText"></span>
</span>

@ -1,4 +1,2 @@
<span>
<span aria-hidden="true" role="presentation" tabindex="-1">-</span>
<span class="hidden-for-sighted"><%= I18n.t('timelines.empty') %></span>
</span>
<accessible-element visible-text="'-'" readable-text="I18n.t('timelines.empty')">
</accessible-element>

Loading…
Cancel
Save