The name resetter should also be run after each render.

This commit is contained in:
George Stephanis 2015-08-07 15:47:26 -04:00
parent c627d49460
commit d5dd12a8f7
1 changed files with 5 additions and 7 deletions

View File

@ -33,6 +33,11 @@
source: data.states, source: data.states,
minLength: 3 minLength: 3
}); });
// Postcode and city don't have `name` values by default. They're only created if the contents changes, to save on database queries (I think)
$tbody.find( 'td.postcode input, td.city input').change(function() {
$(this).attr( 'name', $(this).data( 'name' ) );
});
} }
renderTableContents( data.rates ); renderTableContents( data.rates );
@ -125,12 +130,5 @@
return false; return false;
}); });
/**
* Postcode and city don't have `name` values by default. They're only created if the contents changes, to save on database queries (I think)
*/
$('.wc_tax_rates td.postcode, .wc_tax_rates td.city').find('input').change(function() {
$(this).attr( 'name', $(this).attr( 'data-name' ) );
});
}); });
})(jQuery, htmlSettingsTaxLocalizeScript, wp); })(jQuery, htmlSettingsTaxLocalizeScript, wp);