]> source.dussan.org Git - jquery-ui.git/commitdiff
Tabs: Encode spaces from window.location. Fixes #8777 - Tabs fail in Safari 5.1 when...
authorScott González <scott.gonzalez@gmail.com>
Tue, 6 Nov 2012 13:01:11 +0000 (08:01 -0500)
committerScott González <scott.gonzalez@gmail.com>
Tue, 6 Nov 2012 13:01:11 +0000 (08:01 -0500)
ui/jquery.ui.tabs.js

index f81771434bc66072a8a108168fa5e70cbe433aea..49b6d7bf1cabd46fd04a86d259eb5692b8d82ce1 100644 (file)
@@ -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", {