From: Krinkle Date: Mon, 6 Jun 2011 21:43:03 +0000 (+0000) Subject: Redo r89605 in a better way. X-Git-Tag: 1.31.0-rc.0~29649 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=9b92cb802d2ee5d99c23fb2615716151e770bb20;p=lhc%2Fweb%2Fwiklou.git Redo r89605 in a better way. --- 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;