diff options
author | Alex Rhea <alex.rhea@gmail.com> | 2012-01-03 13:00:02 -0500 |
---|---|---|
committer | Alex Rhea <alex.rhea@gmail.com> | 2012-01-03 13:00:02 -0500 |
commit | eef633e32a20ad93355060a8eef4b2129cf0bc5c (patch) | |
tree | 96157faf660e220badb004bc5babd8062cdb8f9f /ui/jquery.ui.tabs.js | |
parent | ce7918fc73c161ab237f052bad070e34250526be (diff) | |
download | jquery-ui-eef633e32a20ad93355060a8eef4b2129cf0bc5c.tar.gz jquery-ui-eef633e32a20ad93355060a8eef4b2129cf0bc5c.zip |
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
Diffstat (limited to 'ui/jquery.ui.tabs.js')
-rw-r--r-- | ui/jquery.ui.tabs.js | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 5c9fc1326..3e022af4a 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -18,18 +18,13 @@ 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 ) { + 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, "" ) === location.href.replace( rhash, "" ); +}; $.widget( "ui.tabs", { version: "@VERSION", |