]> 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, 13 Nov 2012 15:50:51 +0000 (10:50 -0500)
(cherry picked from commit c6b52db892703ba14153800dbf620db509acb9e6)

ui/jquery.ui.tabs.js

index 0d920c3a13771f4cf0affe4f059673b4190c807c..8f09230c53240fd9c5c920f29337c8493f3389a2 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", {