Removed regex from function and split return into two lines.

This commit is contained in:
Alex Rhea
2012-01-03 13:18:13 -05:00
parent eef633e32a
commit 3c4e40d8d7

View File

@@ -13,17 +13,19 @@
*/
(function( $, undefined ) {
var tabId = 0;
var tabId = 0,
rhash = /#.*$/;
function getNextTabId() {
return ++tabId;
}
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, "" );
return anchor.hash.length > 1 &&
anchor.href.replace( rhash, "" ) === location.href.replace( rhash, "" );
};
$.widget( "ui.tabs", {