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

Side by Side Diff: third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/iron-validatable-behavior-extracted.js

Issue 1221923003: Update bower.json for Polymer elements and add PRESUBMIT.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 1
2 2
3 /** 3 /**
4 * Use `Polymer.IronValidatableBehavior` to implement an element that validate s user input. 4 * Use `Polymer.IronValidatableBehavior` to implement an element that validate s user input.
5 * 5 *
6 * ### Accessiblity 6 * ### Accessiblity
7 * 7 *
8 * Changing the `invalid` property, either manually or by calling `validate()` will update the 8 * Changing the `invalid` property, either manually or by calling `validate()` will update the
9 * `aria-invalid` attribute. 9 * `aria-invalid` attribute.
10 * 10 *
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 */ 71 */
72 hasValidator: function() { 72 hasValidator: function() {
73 return this._validator != null; 73 return this._validator != null;
74 }, 74 },
75 75
76 /** 76 /**
77 * @param {Object} values Passed to the validator's `validate()` function. 77 * @param {Object} values Passed to the validator's `validate()` function.
78 * @return {boolean} True if `values` is valid. 78 * @return {boolean} True if `values` is valid.
79 */ 79 */
80 validate: function(values) { 80 validate: function(values) {
81 var valid = this._validator && this._validator.validate(values); 81 var valid = true;
82 if (this.hasValidator()) {
83 valid = this._validator.validate(values);
84 }
85
82 this.invalid = !valid; 86 this.invalid = !valid;
83 return valid; 87 return valid;
84 } 88 }
85 89
86 }; 90 };
87 91
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698