aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.tabs.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-10-12 11:07:04 -0400
committerScott González <scott.gonzalez@gmail.com>2012-10-12 11:07:04 -0400
commit94221c4e5b11496ef927889e1541d84b5746fb31 (patch)
tree7ffa63470bd85203ff03f22a4f0769cd62c3c172 /ui/jquery.ui.tabs.js
parent1ee090ea9e03c800a764d992506869384409bdb6 (diff)
downloadjquery-ui-94221c4e5b11496ef927889e1541d84b5746fb31.tar.gz
jquery-ui-94221c4e5b11496ef927889e1541d84b5746fb31.zip
Tabs: Use aria-controls instead of the anchor's href to match against location.hash. Fixes #8660 - Tabs: Set initial active tab from location hash for ajax tabs.
Diffstat (limited to 'ui/jquery.ui.tabs.js')
-rw-r--r--ui/jquery.ui.tabs.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index baf55d8dc..7d38fb46e 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -51,7 +51,8 @@ $.widget( "ui.tabs", {
var panel,
that = this,
options = this.options,
- active = options.active;
+ active = options.active,
+ locationHash = location.hash.substring( 1 );
this.running = false;
@@ -80,9 +81,9 @@ $.widget( "ui.tabs", {
if ( active === null ) {
// check the fragment identifier in the URL
- if ( location.hash ) {
- this.anchors.each(function( i, anchor ) {
- if ( anchor.hash === location.hash ) {
+ if ( locationHash ) {
+ this.tabs.each(function( i, tab ) {
+ if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
active = i;
return false;
}