aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.tabs.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/jquery.ui.tabs.js')
-rw-r--r--ui/jquery.ui.tabs.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index 506ee27d7..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;
}
@@ -91,7 +92,7 @@ $.widget( "ui.tabs", {
// check for a tab marked active via a class
if ( active === null ) {
- active = this.tabs.filter( ".ui-tabs-active" ).index();
+ active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
}
// no active tab, set to false