From 4dd45501906d42c48e86562ed29072314942ec20 Mon Sep 17 00:00:00 2001 From: George Stephanis Date: Mon, 10 Aug 2015 18:54:25 -0400 Subject: [PATCH] Add in tracking for changes. --- assets/js/admin/settings-views-html-settings-tax.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/js/admin/settings-views-html-settings-tax.js b/assets/js/admin/settings-views-html-settings-tax.js index 7e72129661b..37d443c58ba 100644 --- a/assets/js/admin/settings-views-html-settings-tax.js +++ b/assets/js/admin/settings-views-html-settings-tax.js @@ -19,6 +19,7 @@ $p_unsaved_msg = $( '#unsaved-changes' ), $pagination = $( '#rates-pagination' ), WCTaxTableModelConstructor = Backbone.Model.extend({ + changes : {}, setRateAttribute : function( rateID, attribute, value ) { var rates = this.get( 'rates' ); @@ -26,6 +27,10 @@ rates[ rateID ][ attribute ] = value; this.set( 'rates', rates ); this.trigger( 'change:rates' ); // Why is this necessary? Shouldn't the previous line trigger it? + + // Store it in a changes array to potentially simplify saving? + this.changes[ rateID ] = this.changes[ rateID ] || {}; + this.changes[ rateID ][ attribute ] = value; } } } ),