Index: chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.js |
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.js b/chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.js |
index 48581ce49f347938ad381b12a80c31cb4d3d2252..b3ff3fb37ce31ce64f546ee2322215e7d9c107d5 100644 |
--- a/chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.js |
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.js |
@@ -43,6 +43,12 @@ Polymer({ |
* @private {!Array<string>} |
*/ |
yearList_: Array, |
+ |
+ /** @private */ |
+ expirationYear_: String, |
+ |
+ /** @private {string|undefined} */ |
+ expirationMonth_: String, |
}, |
behaviors: [ |
@@ -77,10 +83,11 @@ Polymer({ |
} |
this.yearList_ = yearList; |
- this.expirationYear = this.creditCard.expirationYear; |
- this.expirationMonth = this.creditCard.expirationMonth; |
- |
- this.$.dialog.showModal(); |
+ this.async(function() { |
+ this.expirationYear_ = selectedYear.toString(); |
+ this.expirationMonth_ = this.creditCard.expirationMonth; |
+ this.$.dialog.showModal(); |
+ }.bind(this)); |
}, |
/** Closes the dialog. */ |
@@ -101,10 +108,20 @@ Polymer({ |
* @private |
*/ |
onSaveButtonTap_: function() { |
- this.creditCard.expirationYear = this.expirationYear; |
- this.creditCard.expirationMonth = this.expirationMonth; |
+ this.creditCard.expirationYear = this.expirationYear_; |
+ this.creditCard.expirationMonth = this.expirationMonth_; |
this.fire('save-credit-card', this.creditCard); |
this.close(); |
}, |
+ |
+ /** @private */ |
+ onMonthChange_: function() { |
+ this.expirationMonth_ = this.monthList_[this.$.month.selectedIndex]; |
+ }, |
+ |
+ /** @private */ |
+ onYearChange_: function() { |
+ this.expirationYear_ = this.yearList_[this.$.year.selectedIndex]; |
+ }, |
}); |
})(); |