Removing unneeded wraps and using $ and mw instead of jQuery or mediaWiki since r7924...
[lhc/web/wiklou.git] / resources / jquery / jquery.tabIndex.js
1 /**
2 * Finds the lowerst tabindex in use within a selection
3 *
4 * @return number Lowest tabindex on the page
5 */
6 $.fn.firstTabIndex = function() {
7 var minTabIndex = 0;
8 $(this).find( '[tabindex]' ).each( function() {
9 var tabIndex = parseInt( $(this).attr( 'tabindex' ) );
10 if ( tabIndex > minTabIndex ) {
11 minTabIndex = tabIndex;
12 }
13 } );
14 return minTabIndex;
15 };
16
17 /**
18 * Finds the highest tabindex in use within a selection
19 *
20 * @return number Highest tabindex on the page
21 */
22 $.fn.lastTabIndex = function() {
23 var maxTabIndex = 0;
24 $(this).find( '[tabindex]' ).each( function() {
25 var tabIndex = parseInt( $(this).attr( 'tabindex' ) );
26 if ( tabIndex > maxTabIndex ) {
27 maxTabIndex = tabIndex;
28 }
29 } );
30 return maxTabIndex;
31 };