Skip to content

Commit 15e73e3

Browse files
committed
Merge pull request jquery#564 from arhea/master
Tabs isLocal function was not compatible with HTML5 push state
2 parents 07ec849 + 3c4e40d commit 15e73e3

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

ui/jquery.ui.tabs.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,20 @@
1313
*/
1414
(function( $, undefined ) {
1515

16-
var tabId = 0;
16+
var tabId = 0,
17+
rhash = /#.*$/;
18+
1719
function getNextTabId() {
1820
return ++tabId;
1921
}
2022

21-
var isLocal = (function() {
22-
var rhash = /#.*$/,
23-
currentPage = location.href.replace( rhash, "" );
24-
25-
return function( anchor ) {
26-
// clone the node to work around IE 6 not normalizing the href property
27-
// if it's manually set, i.e., a.href = "#foo" kills the normalization
28-
anchor = anchor.cloneNode( false );
29-
return anchor.hash.length > 1 &&
30-
anchor.href.replace( rhash, "" ) === currentPage;
31-
};
32-
})();
23+
var isLocal = function( anchor ) {
24+
// clone the node to work around IE 6 not normalizing the href property
25+
// if it's manually set, i.e., a.href = "#foo" kills the normalization
26+
anchor = anchor.cloneNode( false );
27+
return anchor.hash.length > 1 &&
28+
anchor.href.replace( rhash, "" ) === location.href.replace( rhash, "" );
29+
};
3330

3431
$.widget( "ui.tabs", {
3532
version: "@VERSION",

0 commit comments

Comments
 (0)