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

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

Issue 6274010: DOMUI: Handle textInput in addition to keydown for the AF cc input field. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ee29af77e031572788a5be2d33db1aa1c40305f3..cf5b819f18e9e4d742284f60b0e381d48e78d0ad 100644
--- a/chrome/browser/resources/options/autofill_edit_creditcard_overlay.js
+++ b/chrome/browser/resources/options/autofill_edit_creditcard_overlay.js
@@ -46,7 +46,9 @@ cr.define('options', function() {
self.saveCreditCard_();
self.dismissOverlay_();
}
- $('creditCardNumber').onkeydown = this.onKeyDown_.bind(this);
+ $('creditCardNumber').onkeydown = this.onTextInput_.bind(this);
+ $('creditCardNumber').addEventListener('textInput',
+ this.onTextInput_.bind(this));
self.guid_ = '';
self.storedCCNumber_ = '';
@@ -57,10 +59,13 @@ cr.define('options', function() {
},
/**
- * Handles the keydown event.
+ * Handles the textInput and keydown events.
* @private
*/
- onKeyDown_: function(event) {
+ onTextInput_: function(event) {
+ if (event.type == 'keydown' && event.keyCode != '8')
dhollowa 2011/01/26 01:57:04 What is keyCode '8'? Is there an existing constan
James Hawkins 2011/01/26 01:59:47 Documented in patch set 2.
+ return;
+
// If the user hasn't edited the text yet, delete it all on edit.
if (!this.hasEditedNumber_ &&
$('creditCardNumber').value != this.storedCCNumber_) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698