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

Unified Diff: chrome/browser/resources/chromeos/login/gaia_input_form.js

Issue 1129063003: <gaia-input> element extracted from <gaia-input-form>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected test. Created 5 years, 7 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/chromeos/login/gaia_input_form.js
diff --git a/chrome/browser/resources/chromeos/login/gaia_input_form.js b/chrome/browser/resources/chromeos/login/gaia_input_form.js
index 7306ba7374537c72a43cf2595de5f15116906d5e..d3b13fed1604c5c27f5dde6ea6c30ef8872b92d0 100644
--- a/chrome/browser/resources/chromeos/login/gaia_input_form.js
+++ b/chrome/browser/resources/chromeos/login/gaia_input_form.js
@@ -4,58 +4,14 @@
*/
Polymer('gaia-input-form', (function() {
- var INPUT_EMAIL_PATTERN = "^[a-zA-Z0-9.!#$%&'*+=?^_`{|}~-]+(@[^\\s@]+)?$";
-
return {
-
- inputValue: '',
-
onButtonClicked: function() {
- this.fire('buttonClick');
+ this.fire('submit');
},
onKeyDown: function(e) {
- this.setValid(true);
- this.setDomainVisibility();
if (e.keyCode == 13 && !this.$.button.disabled)
- this.$.button.fire('tap');
- },
-
- onKeyUp: function(e) {
- this.setDomainVisibility();
- },
-
- setDomainVisibility: function() {
- this.$.emailDomain.hidden = !(this.inputValue.indexOf('@') === -1);
- },
-
- ready: function() {
- if (this.inputType == 'email') {
- this.$.inputForm.type = 'text';
- this.$.inputForm.pattern = INPUT_EMAIL_PATTERN;
- this.$.inputForm.addEventListener('keyup', this.onKeyUp.bind(this));
- } else {
- this.$.inputForm.type = this.inputType;
- }
- },
-
- onTap: function() {
- this.setValid(true);
- },
-
- focus: function() {
- this.$.inputForm.focus();
- },
-
- checkValidity: function() {
- var input = this.$.inputForm;
- var isValid = input.validity.valid;
- this.setValid(isValid);
- return isValid;
- },
-
- setValid: function(isValid) {
- this.$.paperInputDecorator.isInvalid = !isValid;
+ this.onButtonClicked();
}
};
})());

Powered by Google App Engine
This is Rietveld 408576698