From 55e0bb630271f769a632cd2b64482b12f408b592 Mon Sep 17 00:00:00 2001 From: George Stephanis Date: Fri, 7 Aug 2015 15:30:12 -0400 Subject: [PATCH] Add some code comments. --- assets/js/admin/settings-views-html-settings-tax.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/assets/js/admin/settings-views-html-settings-tax.js b/assets/js/admin/settings-views-html-settings-tax.js index 348b425db79..93c78f4c286 100644 --- a/assets/js/admin/settings-views-html-settings-tax.js +++ b/assets/js/admin/settings-views-html-settings-tax.js @@ -8,7 +8,10 @@ $tbody = $('#rates'); $(function() { + // Blank out the contents. $tbody.innerHTML = ''; + + // Populate $tbody with the current page of results. $.each( data.rates, function ( id, rowData ) { $tbody.append( rowTemplate( rowData ) ); } ); @@ -45,6 +48,11 @@ return false; }); + /** + * Handle the exporting of tax rates. + * + * As an aside: Why is this being handled in Javascript instead of being built by php? -George + */ $('.wc_tax_rates .export').click(function() { var csv_data = 'data:application/csv;charset=utf-8,' + data.strings.csv_data_cols.join(',') + '\n'; @@ -77,6 +85,9 @@ return true; }); + /** + * Add a new blank row to the table for the user to fill out and save. + */ $('.wc_tax_rates .insert').click(function() { var size = $tbody.find('tr').length; var code = wp.template( 'wc-tax-table-row' )( {