Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1094)

Unified Diff: chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.js

Issue 2383513003: MD Settings: Migrating add/edit credit card dropdowns to native select. (Closed)
Patch Set: Address comments. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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];
+ },
});
})();

Powered by Google App Engine
This is Rietveld 408576698