Accessibility: Menu / Offcanvas: Offcanvas and hamburger toggle menu are now ARIA compatible (fixes #1891)

This commit is contained in:
Djamil Legato
2017-06-27 18:07:07 -07:00
parent 186c0fe8df
commit e0661cb7b6
4 changed files with 11 additions and 1 deletions
+2
View File
@@ -2,6 +2,8 @@
## mm/dd/2017
1. [Common](#common)
2. [](#bugfix)
- Accessibility: Menu / Offcanvas: Offcanvas and hamburger toggle menu are now ARIA compatible (#1891)
3. [](#bugfix)
- Menu: Disable Dropdowns still Shows Indicator (#2031)
- Menu: Fixed frontend menu 'Extended' option, resetting heights of wrapping containers not necessarily related to the menu itself (#2025)
@@ -208,6 +208,8 @@ var Offcanvas = new prime({
var panel = this.panel[0];
this.htmlEl.removeClass(this.options.openingClass);
this.offcanvas.attribute('aria-expanded', true);
$('[data-offcanvas-toggle]').attribute('aria-expanded', true);
panel.style.transition = panel.style[prefix.css + 'transition'] = '';
}, this), this.options.duration);
@@ -230,6 +232,8 @@ var Offcanvas = new prime({
this._setTransition();
this._translateXTo(0);
this.opened = false;
this.offcanvas.attribute('aria-expanded', false);
$('[data-offcanvas-toggle]').attribute('aria-expanded', false);
setTimeout(bind(function() {
var panel = this.panel[0];
+4
View File
@@ -601,6 +601,8 @@ var Offcanvas = new prime({
var panel = this.panel[0];
this.htmlEl.removeClass(this.options.openingClass);
this.offcanvas.attribute('aria-expanded', true);
$('[data-offcanvas-toggle]').attribute('aria-expanded', true);
panel.style.transition = panel.style[prefix.css + 'transition'] = '';
}, this), this.options.duration);
@@ -623,6 +625,8 @@ var Offcanvas = new prime({
this._setTransition();
this._translateXTo(0);
this.opened = false;
this.offcanvas.attribute('aria-expanded', false);
$('[data-offcanvas-toggle]').attribute('aria-expanded', false);
setTimeout(bind(function() {
var panel = this.panel[0];
@@ -88,7 +88,7 @@
{{ page_offcanvas|raw }}
<div id="g-page-surround">
{% if page_offcanvas|trim -%}
<div class="g-offcanvas-hide g-offcanvas-toggle" data-offcanvas-toggle><i class="fa fa-fw fa-bars" aria-hidden="true"></i></div>
<div class="g-offcanvas-hide g-offcanvas-toggle" data-offcanvas-toggle aria-controls="g-offcanvas" aria-expanded="false"><i class="fa fa-fw fa-bars"></i></div>
{%- endif %}
{{ page_top|raw }}
{{ page_layout|raw }}