From 91d8ce1bd43272472019784b182da069e6cce4da Mon Sep 17 00:00:00 2001 From: George Stephanis Date: Wed, 12 Aug 2015 14:44:24 -0400 Subject: [PATCH] Move deletion block to be adjacent to creation block. --- .../admin/settings-views-html-settings-tax.js | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/assets/js/admin/settings-views-html-settings-tax.js b/assets/js/admin/settings-views-html-settings-tax.js index 011bca082bb..ff30e39d1f9 100644 --- a/assets/js/admin/settings-views-html-settings-tax.js +++ b/assets/js/admin/settings-views-html-settings-tax.js @@ -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);