mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
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
This commit is contained in:
parent
ce7918fc73
commit
eef633e32a
19
ui/jquery.ui.tabs.js
vendored
19
ui/jquery.ui.tabs.js
vendored
@ -18,18 +18,13 @@ function getNextTabId() {
|
|||||||
return ++tabId;
|
return ++tabId;
|
||||||
}
|
}
|
||||||
|
|
||||||
var isLocal = (function() {
|
var isLocal = function( anchor ) {
|
||||||
var rhash = /#.*$/,
|
var rhash = /#.*$/;
|
||||||
currentPage = location.href.replace( rhash, "" );
|
// clone the node to work around IE 6 not normalizing the href property
|
||||||
|
// if it's manually set, i.e., a.href = "#foo" kills the normalization
|
||||||
return function( anchor ) {
|
anchor = anchor.cloneNode( false );
|
||||||
// clone the node to work around IE 6 not normalizing the href property
|
return anchor.hash.length > 1 && anchor.href.replace( rhash, "" ) === location.href.replace( rhash, "" );
|
||||||
// if it's manually set, i.e., a.href = "#foo" kills the normalization
|
};
|
||||||
anchor = anchor.cloneNode( false );
|
|
||||||
return anchor.hash.length > 1 &&
|
|
||||||
anchor.href.replace( rhash, "" ) === currentPage;
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
|
|
||||||
$.widget( "ui.tabs", {
|
$.widget( "ui.tabs", {
|
||||||
version: "@VERSION",
|
version: "@VERSION",
|
||||||
|
Loading…
Reference in New Issue
Block a user