diff options
author | Monika Piotrowicz <monika@shopify.com> | 2013-10-27 21:57:01 -0400 |
---|---|---|
committer | TJ VanToll <tj.vantoll@gmail.com> | 2013-10-28 10:32:25 -0400 |
commit | f16d0c7e267794aa20411581b15870d9babd7930 (patch) | |
tree | a05aa5ed48e7b68a157721b6db765203e25640e6 /ui/jquery.ui.accordion.js | |
parent | 7e68945c2cf0857f9edcff03f32625cab94ccb25 (diff) | |
download | jquery-ui-f16d0c7e267794aa20411581b15870d9babd7930.tar.gz jquery-ui-f16d0c7e267794aa20411581b15870d9babd7930.zip |
Accordion: moving aria-expanded from active tabpanel to active tab. Fixed #9407 - Accordion: aria-expanded attribute on wrong element
Diffstat (limited to 'ui/jquery.ui.accordion.js')
-rw-r--r-- | ui/jquery.ui.accordion.js | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 78a729f5f..131d12c32 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -109,6 +109,7 @@ $.widget( "ui.accordion", { .removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " + "ui-corner-all ui-state-active ui-state-disabled ui-corner-top" ) .removeAttr( "role" ) + .removeAttr( "aria-expanded" ) .removeAttr( "aria-selected" ) .removeAttr( "aria-controls" ) .removeAttr( "tabIndex" ) @@ -122,7 +123,6 @@ $.widget( "ui.accordion", { "ui-accordion-content ui-accordion-content-active ui-state-disabled" ) .css( "display", "" ) .removeAttr( "role" ) - .removeAttr( "aria-expanded" ) .removeAttr( "aria-hidden" ) .removeAttr( "aria-labelledby" ) .removeUniqueId(); @@ -288,11 +288,11 @@ $.widget( "ui.accordion", { .not( this.active ) .attr({ "aria-selected": "false", + "aria-expanded": "false", tabIndex: -1 }) .next() .attr({ - "aria-expanded": "false", "aria-hidden": "true" }) .hide(); @@ -303,11 +303,11 @@ $.widget( "ui.accordion", { } else { this.active.attr({ "aria-selected": "true", + "aria-expanded": "true", tabIndex: 0 }) .next() .attr({ - "aria-expanded": "true", "aria-hidden": "false" }); } @@ -462,7 +462,6 @@ $.widget( "ui.accordion", { } toHide.attr({ - "aria-expanded": "false", "aria-hidden": "true" }); toHide.prev().attr( "aria-selected", "false" ); @@ -470,7 +469,10 @@ $.widget( "ui.accordion", { // if we're opening from collapsed state, remove the previous header from the tab order // if we're collapsing, then keep the collapsing header in the tab order if ( toShow.length && toHide.length ) { - toHide.prev().attr( "tabIndex", -1 ); + toHide.prev().attr({ + "tabIndex": -1, + "aria-expanded": "false" + }); } else if ( toShow.length ) { this.headers.filter(function() { return $( this ).attr( "tabIndex" ) === 0; @@ -479,14 +481,12 @@ $.widget( "ui.accordion", { } toShow - .attr({ - "aria-expanded": "true", - "aria-hidden": "false" - }) + .attr( "aria-hidden", "false" ) .prev() .attr({ "aria-selected": "true", - tabIndex: 0 + tabIndex: 0, + "aria-expanded": "true" }); }, @@ -558,7 +558,6 @@ $.widget( "ui.accordion", { if ( toHide.length ) { toHide.parent()[0].className = toHide.parent()[0].className; } - this._trigger( "activate", null, data ); } }); |