diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-01-19 14:05:00 -0800 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-01-19 14:05:00 -0800 |
commit | 15e73e38b2976ae6bca8d000ed3b808841cd4492 (patch) | |
tree | cc882b545ec945609241e88b7d3bfe79790d7202 /ui | |
parent | 07ec849f623699c87fc7ecc3770ea11ad9ba8e4e (diff) | |
parent | 3c4e40d8d770ac117969b2cb011ac3d7402a134a (diff) | |
download | jquery-ui-15e73e38b2976ae6bca8d000ed3b808841cd4492.tar.gz jquery-ui-15e73e38b2976ae6bca8d000ed3b808841cd4492.zip |
Merge pull request #564 from arhea/master
Tabs isLocal function was not compatible with HTML5 push state
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.tabs.js | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 5c9fc1326..0429363f2 100644 --- a/ui/jquery.ui.tabs.js +++ b/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", |