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

Unified Diff: chrome/browser/resources/options/autofill_edit_address_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
« no previous file with comments | « no previous file | chrome/browser/resources/options/autofill_edit_creditcard_overlay.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/autofill_edit_address_overlay.js
diff --git a/chrome/browser/resources/options/autofill_edit_address_overlay.js b/chrome/browser/resources/options/autofill_edit_address_overlay.js
index 9582ed23342b41a4925dde349e73769863a6786b..2ecbea3604296ec321e89454d6e07f285523dfe4 100644
--- a/chrome/browser/resources/options/autofill_edit_address_overlay.js
+++ b/chrome/browser/resources/options/autofill_edit_address_overlay.js
@@ -325,6 +325,15 @@ cr.define('options', function() {
},
/**
+ * Called to prepare the overlay when a new address is being added.
+ * @private
+ */
+ prepForNewAddress_: function() {
+ // Focus the first element.
+ this.pageDiv.querySelector('input').focus();
+ },
+
+ /**
* Loads the address data from |address|, sets the input fields based on
* this data, and stores the GUID and language code of the address.
* @param {!Object} address Lots of info about an address from the browser.
@@ -407,6 +416,10 @@ cr.define('options', function() {
},
};
+ AutofillEditAddressOverlay.prepForNewAddress = function() {
+ AutofillEditAddressOverlay.getInstance().prepForNewAddress_();
+ };
+
AutofillEditAddressOverlay.loadAddress = function(address) {
AutofillEditAddressOverlay.getInstance().loadAddress_(address);
};
« no previous file with comments | « no previous file | chrome/browser/resources/options/autofill_edit_creditcard_overlay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698