aboutsummaryrefslogtreecommitdiffstats
path: root/ui/widgets/tabs.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/widgets/tabs.js')
-rw-r--r--ui/widgets/tabs.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/ui/widgets/tabs.js b/ui/widgets/tabs.js
index 72b868e4f..7b7907c32 100644
--- a/ui/widgets/tabs.js
+++ b/ui/widgets/tabs.js
@@ -121,14 +121,14 @@ $.widget( "ui.tabs", {
_initialActive: function() {
var active = this.options.active,
collapsible = this.options.collapsible,
- locationHash = location.hash.substring( 1 );
+ locationHashDecoded = decodeURIComponent( location.hash.substring( 1 ) );
if ( active === null ) {
// check the fragment identifier in the URL
- if ( locationHash ) {
+ if ( locationHashDecoded ) {
this.tabs.each( function( i, tab ) {
- if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
+ if ( $( tab ).attr( "aria-controls" ) === locationHashDecoded ) {
active = i;
return false;
}
@@ -312,10 +312,6 @@ $.widget( "ui.tabs", {
}
},
- _sanitizeSelector: function( hash ) {
- return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
- },
-
refresh: function() {
var options = this.options,
lis = this.tablist.children( ":has(a[href])" );
@@ -434,9 +430,9 @@ $.widget( "ui.tabs", {
// Inline tab
if ( that._isLocal( anchor ) ) {
- selector = anchor.hash;
+ selector = decodeURIComponent( anchor.hash );
panelId = selector.substring( 1 );
- panel = that.element.find( that._sanitizeSelector( selector ) );
+ panel = that.element.find( "#" + CSS.escape( panelId ) );
// remote tab
} else {
@@ -874,7 +870,7 @@ $.widget( "ui.tabs", {
_getPanelForTab: function( tab ) {
var id = $( tab ).attr( "aria-controls" );
- return this.element.find( this._sanitizeSelector( "#" + id ) );
+ return this.element.find( "#" + CSS.escape( id ) );
}
} );