Skip to content

Commit

Permalink
Tabs: Encode spaces from window.location. Fixes #8777 - Tabs fail in …
Browse files Browse the repository at this point in the history
…Safari 5.1 when window.location contains a space.

(cherry picked from commit c6b52db)
  • Loading branch information
scottgonzalez committed Nov 13, 2012
1 parent 310dff1 commit cdccd99
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ui/jquery.ui.tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ function getNextTabId() {

function isLocal( anchor ) {
return anchor.hash.length > 1 &&
anchor.href.replace( rhash, "" ) === location.href.replace( rhash, "" );
anchor.href.replace( rhash, "" ) ===
location.href.replace( rhash, "" )
// support: Safari 5.1
// Safari 5.1 doesn't encode spaces in window.location
// but it does encode spaces from anchors (#8777)
.replace( /\s/g, "%20" );
}

$.widget( "ui.tabs", {
Expand Down

0 comments on commit cdccd99

Please sign in to comment.