Fixing some JS notices when working with the tax table
This commit is contained in:
parent
47605935ab
commit
42a853c90b
|
@ -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
|
@ -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
Loading…
Reference in New Issue