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
11
ui/jquery.ui.tabs.js
vendored
11
ui/jquery.ui.tabs.js
vendored
@ -18,18 +18,13 @@ function getNextTabId() {
|
||||
return ++tabId;
|
||||
}
|
||||
|
||||
var isLocal = (function() {
|
||||
var rhash = /#.*$/,
|
||||
currentPage = location.href.replace( rhash, "" );
|
||||
|
||||
return function( anchor ) {
|
||||
var isLocal = function( anchor ) {
|
||||
var 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
|
||||
anchor = anchor.cloneNode( false );
|
||||
return anchor.hash.length > 1 &&
|
||||
anchor.href.replace( rhash, "" ) === currentPage;
|
||||
return anchor.hash.length > 1 && anchor.href.replace( rhash, "" ) === location.href.replace( rhash, "" );
|
||||
};
|
||||
})();
|
||||
|
||||
$.widget( "ui.tabs", {
|
||||
version: "@VERSION",
|
||||
|
Loading…
Reference in New Issue
Block a user