Revert back to passing in array values. We can indexBy in JS

This commit is contained in:
George Stephanis 2015-08-12 17:17:39 -04:00
parent e7347ecca4
commit e10064d0fe
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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,