Skip to content
Permalink
Browse files

Merge pull request #564 from arhea/master

Tabs isLocal function was not compatible with HTML5 push state
  • Loading branch information
scottgonzalez committed Jan 19, 2012
2 parents 07ec849 + 3c4e40d commit 15e73e38b2976ae6bca8d000ed3b808841cd4492
Showing with 10 additions and 13 deletions.
  1. +10 −13 ui/jquery.ui.tabs.js
@@ -13,23 +13,20 @@
*/
(function( $, undefined ) {

var tabId = 0;
var tabId = 0,
rhash = /#.*$/;

function getNextTabId() {
return ++tabId;
}

var isLocal = (function() {
var rhash = /#.*$/,
currentPage = location.href.replace( rhash, "" );

return function( anchor ) {
// 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;
};
})();
var isLocal = function( anchor ) {
// 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, "" ) === location.href.replace( rhash, "" );
};

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

0 comments on commit 15e73e3

Please sign in to comment.
You can’t perform that action at this time.