From 9b92cb802d2ee5d99c23fb2615716151e770bb20 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Mon, 6 Jun 2011 21:43:03 +0000 Subject: [PATCH] Redo r89605 in a better way. --- resources/jquery/jquery.tabIndex.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/resources/jquery/jquery.tabIndex.js b/resources/jquery/jquery.tabIndex.js index ab708c7bca..4a42a7e96d 100644 --- a/resources/jquery/jquery.tabIndex.js +++ b/resources/jquery/jquery.tabIndex.js @@ -11,13 +11,15 @@ $.fn.firstTabIndex = function() { var minTabIndex = null; $(this).find( '[tabindex]' ).each( function( i ) { var tabIndex = parseInt( $(this).attr( 'tabindex' ), 10 ); - if ( i === 0 ) { - minTabIndex = tabIndex; // In IE6/IE7 the above jQuery selector returns all elements, // becuase it has a default value for tabIndex in IE6/IE7 of 0 // (rather than null/undefined). Therefore check "> 0" as well - } else if ( tabIndex > 0 && tabIndex < minTabIndex ) { - minTabIndex = tabIndex; + if ( tabIndex > 0 ) { + if ( i === 0 ) { + minTabIndex = tabIndex; + } else if ( tabIndex < minTabIndex ) { + minTabIndex = tabIndex; + } } } ); return minTabIndex; -- 2.20.1