Skip to content

Commit eef633e

Browse files
committed
Bug fix for isLocal function in jQuery Tabs.
isLocal function was not compatible with HTML5 push state as the url could have changed since the page was loaded as in cases with Backbone.js
1 parent ce7918f commit eef633e

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

ui/jquery.ui.tabs.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@ function getNextTabId() {
1818
return ++tabId;
1919
}
2020

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

3429
$.widget( "ui.tabs", {
3530
version: "@VERSION",

0 commit comments

Comments
 (0)