Add some code comments.

This commit is contained in:
George Stephanis 2015-08-07 15:30:12 -04:00
parent bad9e9d3bd
commit 55e0bb6302
1 changed files with 11 additions and 0 deletions

View File

@ -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' )( {