| OLD | NEW |
| 1 Polymer({ | 1 Polymer({ |
| 2 is: 'paper-input-container', | 2 is: 'paper-input-container', |
| 3 | 3 |
| 4 properties: { | 4 properties: { |
| 5 /** | 5 /** |
| 6 * Set to true to disable the floating label. The label disappears when th
e input value is | 6 * Set to true to disable the floating label. The label disappears when th
e input value is |
| 7 * not null. | 7 * not null. |
| 8 */ | 8 */ |
| 9 noLabelFloat: { | 9 noLabelFloat: { |
| 10 type: Boolean, | 10 type: Boolean, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 get _inputElementValue() { | 121 get _inputElementValue() { |
| 122 return this._inputElement[this._propertyForValue] || this._inputElement.va
lue; | 122 return this._inputElement[this._propertyForValue] || this._inputElement.va
lue; |
| 123 }, | 123 }, |
| 124 | 124 |
| 125 ready: function() { | 125 ready: function() { |
| 126 if (!this._addons) { | 126 if (!this._addons) { |
| 127 this._addons = []; | 127 this._addons = []; |
| 128 } | 128 } |
| 129 this.addEventListener('focus', this._boundOnFocus, true); | 129 this.addEventListener('focus', this._boundOnFocus, true); |
| 130 this.addEventListener('blur', this._boundOnBlur, true); | 130 this.addEventListener('blur', this._boundOnBlur, true); |
| 131 }, |
| 132 |
| 133 attached: function() { |
| 131 if (this.attrForValue) { | 134 if (this.attrForValue) { |
| 132 this._inputElement.addEventListener(this._valueChangedEvent, this._bound
ValueChanged); | 135 this._inputElement.addEventListener(this._valueChangedEvent, this._bound
ValueChanged); |
| 133 } else { | 136 } else { |
| 134 this.addEventListener('input', this._onInput); | 137 this.addEventListener('input', this._onInput); |
| 135 } | 138 } |
| 136 }, | |
| 137 | 139 |
| 138 attached: function() { | |
| 139 // Only validate when attached if the input already has a value. | 140 // Only validate when attached if the input already has a value. |
| 140 if (this._inputElementValue != '') { | 141 if (this._inputElementValue != '') { |
| 141 this._handleValueAndAutoValidate(this._inputElement); | 142 this._handleValueAndAutoValidate(this._inputElement); |
| 142 } else { | 143 } else { |
| 143 this._handleValue(this._inputElement); | 144 this._handleValue(this._inputElement); |
| 144 } | 145 } |
| 145 }, | 146 }, |
| 146 | 147 |
| 147 _onAddonAttached: function(event) { | 148 _onAddonAttached: function(event) { |
| 148 if (!this._addons) { | 149 if (!this._addons) { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 _computeAddOnContentClass: function(focused, invalid) { | 270 _computeAddOnContentClass: function(focused, invalid) { |
| 270 var cls = 'add-on-content'; | 271 var cls = 'add-on-content'; |
| 271 if (invalid) { | 272 if (invalid) { |
| 272 cls += ' is-invalid'; | 273 cls += ' is-invalid'; |
| 273 } else if (focused) { | 274 } else if (focused) { |
| 274 cls += ' is-highlighted' | 275 cls += ' is-highlighted' |
| 275 } | 276 } |
| 276 return cls; | 277 return cls; |
| 277 } | 278 } |
| 278 }); | 279 }); |
| OLD | NEW |