Move deletion block to be adjacent to creation block.

This commit is contained in:
George Stephanis 2015-08-12 14:44:24 -04:00
parent 1b435e18c2
commit 91d8ce1bd4
1 changed files with 22 additions and 18 deletions

View File

@ -201,24 +201,6 @@
WCTaxTableInstance.updateUrl();
} );
$table.find('.remove_tax_rates').click(function() {
if ( $tbody.find('tr.current').length > 0 ) {
var $current = $tbody.find('tr.current');
$current.find('input').val('');
$current.find('input.remove_tax_rate').val('1');
$current.each(function(){
if ( $(this).is('.new') ) {
$( this ).remove();
} else {
$( this ).hide();
}
});
} else {
window.alert( data.strings.no_rows_selected );
}
return false;
});
/**
* Handle searches.
*/
@ -286,5 +268,27 @@
return false;
});
/**
* Removals.
*/
$table.find('.remove_tax_rates').click(function() {
if ( $tbody.find('tr.current').length > 0 ) {
var $current = $tbody.find('tr.current');
$current.find('input').val('');
$current.find('input.remove_tax_rate').val('1');
$current.each(function(){
if ( $(this).is('.new') ) {
$( this ).remove();
} else {
$( this ).hide();
}
});
} else {
window.alert( data.strings.no_rows_selected );
}
return false;
});
});
})(jQuery, htmlSettingsTaxLocalizeScript, wp);