Skip to content

Commit

Permalink
issue-1051: added accessibility helpers (#1170)
Browse files Browse the repository at this point in the history
* issue-1051: added accessibility helpers

* issue-1051: force spaces for attributes

* issue-1051: removed unnecessary a11y-ignore-focus
  • Loading branch information
oliverfoster authored Jul 27, 2016
1 parent 9c67630 commit 9d43a02
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/core/js/accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,26 @@ define(function(require) {
return $.a11y_normalize(text);
});

Handlebars.registerHelper('a11y_aria_label', function(text) {
return '<div class="aria-label prevent-default" tabindex="0" role="region">'+text+'</div>';
});

Handlebars.registerHelper('a11y_aria_label_relative', function(text) {
return '<div class="aria-label relative prevent-default" tabindex="0" role="region">'+text+'</div>';
});

Handlebars.registerHelper('a11y_wrap_focus', function(text) {
return '<a id="a11y-focusguard" class="a11y-ignore a11y-ignore-focus" tabindex="0" role="button">&nbsp;</a>';
});

Handlebars.registerHelper('a11y_attrs_heading', function(level) {
return ' role="heading" aria-level="'+level+'" tabindex="0" ';
});

Handlebars.registerHelper('a11y_attrs_tabbable', function() {
return ' role="region" tabindex="0" ';
});

},

setupToggleButton: function() {
Expand Down

0 comments on commit 9d43a02

Please sign in to comment.