From 9d43a02d268bb6dfd552c576eb4aab4f8fed8b77 Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Wed, 27 Jul 2016 11:05:24 +0100 Subject: [PATCH] issue-1051: added accessibility helpers (#1170) * issue-1051: added accessibility helpers * issue-1051: force spaces for attributes * issue-1051: removed unnecessary a11y-ignore-focus --- src/core/js/accessibility.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/core/js/accessibility.js b/src/core/js/accessibility.js index 42d2cf2e8..839e8ba0f 100644 --- a/src/core/js/accessibility.js +++ b/src/core/js/accessibility.js @@ -116,6 +116,26 @@ define(function(require) { return $.a11y_normalize(text); }); + Handlebars.registerHelper('a11y_aria_label', function(text) { + return '
'+text+'
'; + }); + + Handlebars.registerHelper('a11y_aria_label_relative', function(text) { + return '
'+text+'
'; + }); + + Handlebars.registerHelper('a11y_wrap_focus', function(text) { + return ' '; + }); + + 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() {