From: Krinkle Date: Sun, 22 May 2011 23:52:16 +0000 (+0000) Subject: jquery.tabIndex.js was broken, not it works (for the first time?) X-Git-Tag: 1.31.0-rc.0~30001 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=afaf4e39db993b6b03650732fe58f1a79c913bd2;p=lhc%2Fweb%2Fwiklou.git jquery.tabIndex.js was broken, not it works (for the first time?) * Defaulting to null * Setting to initial value during first iteration (instead of outside the loop), that way we dont have to set minTabIndex to some insane high value to let if ( .. > .. ) work * (bug 29048) jQuery.tabIndex: firstTabIndex() outputs the same as lastTabIndex() * Added extra \ + \ + \ + \ '; - var $test = $( '
' ).html( testEnvironment ).appendTo( 'body' ); + var $testA = $( '
' ).html( testEnvironment ).appendTo( 'body' ); - deepEqual( $test.firstTabIndex(), 2, 'First tabindex should be 2 within this context.' ); + deepEqual( $testA.firstTabIndex(), 2, 'First tabindex should be 2 within this context.' ); + + var $testB = $( '
' ); + + deepEqual( $testB.firstTabIndex(), null, 'Return null if none available.' ); // Clean up - $test.remove(); + $testA.add( $testB).remove(); }); test( 'lastTabIndex', function(){ @@ -28,13 +33,18 @@ test( 'lastTabIndex', function(){ var testEnvironment = '
\ \ - \ - \ + \ + \ + \
'; - var $test = $( '
' ).html( testEnvironment ).appendTo( 'body' ); + var $testA = $( '
' ).html( testEnvironment ).appendTo( 'body' ); + + deepEqual( $testA.lastTabIndex(), 9, 'Last tabindex should be 9 within this context.' ); + + var $testB = $( '
' ); - deepEqual( $test.lastTabIndex(), 9, 'Last tabindex should be 9 within this context.' ); + deepEqual( $testB.lastTabIndex(), null, 'Return null if none available.' ); // Clean up - $test.remove(); + $testA.add( $testB).remove(); }); \ No newline at end of file