Revert back to passing in array values. We can indexBy in JS
This commit is contained in:
parent
e7347ecca4
commit
e10064d0fe
|
@ -23,7 +23,7 @@
|
|||
WCTaxTableModelConstructor = Backbone.Model.extend({
|
||||
changes : {},
|
||||
setRateAttribute : function( rateID, attribute, value ) {
|
||||
var rates = this.get( 'rates' );
|
||||
var rates = _.indexBy( this.get( 'rates' ), 'tax_rate_id' );
|
||||
|
||||
if ( rates[ rateID ][ attribute ] !== value ) {
|
||||
rates[ rateID ][ attribute ] = value;
|
||||
|
|
|
@ -157,7 +157,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
wp_localize_script( 'wc-settings-tax', 'htmlSettingsTaxLocalizeScript', array(
|
||||
'current_class' => $current_class,
|
||||
'base_url' => $base_url,
|
||||
'rates' => $rates,
|
||||
'rates' => array_values( $rates ),
|
||||
'page' => ! empty( $_GET['p'] ) ? absint( $_GET['p'] ) : 1,
|
||||
'limit' => 100,
|
||||
'countries' => $countries,
|
||||
|
|
Loading…
Reference in New Issue