Fixing some JS notices when working with the tax table

This commit is contained in:
Mike Jolley 2015-10-08 12:57:42 +01:00
parent 47605935ab
commit 42a853c90b
4 changed files with 7 additions and 7 deletions

View File

@ -190,11 +190,11 @@
} ),
$current, current_id, current_order, rates_to_reorder, reordered_rates;
event.preventDefault();
$current = $tbody.children( '.current' );
if ( $current = $tbody.children( '.current' ) ) {
current_id = $current.last().data( 'id' );
current_order = parseInt( rates[ current_id ].tax_rate_order, 10 );
if ( $current.length ) {
current_id = $current.last().data( 'id' );
current_order = parseInt( rates[ current_id ].tax_rate_order, 10 );
newRow.tax_rate_order = 1 + current_order;
rates_to_reorder = _.filter( rates, function( rate ) {

File diff suppressed because one or more lines are too long

View File

@ -147,7 +147,7 @@ jQuery( function ( $ ) {
$this_row.addClass( 'selected_now' ).addClass( 'current' );
if ( $( 'tr.last_selected', $this_table ).size() > 0 ) {
if ( $this_row.index() > $( 'tr.last_selected, $this_table' ).index() ) {
if ( $this_row.index() > $( 'tr.last_selected', $this_table ).index() ) {
$( 'tr', $this_table ).slice( $( 'tr.last_selected', $this_table ).index(), $this_row.index() ).addClass( 'current' );
} else {
$( 'tr', $this_table ).slice( $this_row.index(), $( 'tr.last_selected', $this_table ).index() + 1 ).addClass( 'current' );

File diff suppressed because one or more lines are too long