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 c9a1ba2f39
commit 0608bcce19
1 changed files with 5 additions and 7 deletions

View File

@ -33,6 +33,11 @@
source: data.states,
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 );
@ -125,12 +130,5 @@
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);