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

Unified Diff: chrome/browser/resources/options/autofill_edit_creditcard_overlay.js

Issue 516403003: Focus the first input when adding a new Autofill cc or address (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new function instead Created 6 years, 3 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/options/autofill_edit_creditcard_overlay.js
diff --git a/chrome/browser/resources/options/autofill_edit_creditcard_overlay.js b/chrome/browser/resources/options/autofill_edit_creditcard_overlay.js
index 4458ecc17616bb2a1135f50a6f70d08b80928f07..5f1091c8250f941afc0f63a76d023275788dc109 100644
--- a/chrome/browser/resources/options/autofill_edit_creditcard_overlay.js
+++ b/chrome/browser/resources/options/autofill_edit_creditcard_overlay.js
@@ -179,6 +179,15 @@ cr.define('options', function() {
},
/**
+ * Called to prepare the overlay when a new card is being added.
+ * @private
+ */
+ prepForNewCard_: function() {
+ // Focus the first element.
+ this.pageDiv.querySelector('input').focus();
+ },
+
+ /**
* Loads the credit card data from |creditCard|, sets the input fields based
* on this data and stores the GUID of the credit card.
* @private
@@ -190,6 +199,10 @@ cr.define('options', function() {
},
};
+ AutofillEditCreditCardOverlay.prepForNewCard = function() {
+ AutofillEditCreditCardOverlay.getInstance().prepForNewCard_();
+ };
+
AutofillEditCreditCardOverlay.loadCreditCard = function(creditCard) {
AutofillEditCreditCardOverlay.getInstance().loadCreditCard_(creditCard);
};

Powered by Google App Engine
This is Rietveld 408576698