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

Side by Side Diff: third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea-extracted.js

Issue 1401633002: Update Polymer from 1.1.4 -> 1.1.5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dzhioev@ review Created 5 years, 2 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 Polymer({
2 2
3 Polymer({
4
5 is: 'iron-autogrow-textarea', 3 is: 'iron-autogrow-textarea',
6 4
7 behaviors: [ 5 behaviors: [
8 Polymer.IronFormElementBehavior, 6 Polymer.IronFormElementBehavior,
9 Polymer.IronValidatableBehavior, 7 Polymer.IronValidatableBehavior,
10 Polymer.IronControlState 8 Polymer.IronControlState
11 ], 9 ],
12 10
13 properties: { 11 properties: {
14 12
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 this.fire('iron-input-validate'); 179 this.fire('iron-input-validate');
182 return valid; 180 return valid;
183 }, 181 },
184 182
185 _bindValueChanged: function() { 183 _bindValueChanged: function() {
186 var textarea = this.textarea; 184 var textarea = this.textarea;
187 if (!textarea) { 185 if (!textarea) {
188 return; 186 return;
189 } 187 }
190 188
191 textarea.value = this.bindValue; 189 // If the bindValue changed manually, then we need to also update
190 // the underlying textarea's value. Otherwise this change was probably
191 // generated from the _onInput handler, and the two values are already
192 // the same.
193 if (textarea.value !== this.bindValue) {
194 textarea.value = !(this.bindValue || this.bindValue === 0) ? '' : this.b indValue;
195 }
196
192 this.$.mirror.innerHTML = this._valueForMirror(); 197 this.$.mirror.innerHTML = this._valueForMirror();
193 // manually notify because we don't want to notify until after setting val ue 198 // manually notify because we don't want to notify until after setting val ue
194 this.fire('bind-value-changed', {value: this.bindValue}); 199 this.fire('bind-value-changed', {value: this.bindValue});
195 }, 200 },
196 201
197 _onInput: function(event) { 202 _onInput: function(event) {
198 this.bindValue = event.path ? event.path[0].value : event.target.value; 203 this.bindValue = event.path ? event.path[0].value : event.target.value;
199 }, 204 },
200 205
201 _constrain: function(tokens) { 206 _constrain: function(tokens) {
(...skipping 20 matching lines...) Expand all
222 return this._constrain(this.tokens); 227 return this._constrain(this.tokens);
223 }, 228 },
224 229
225 _updateCached: function() { 230 _updateCached: function() {
226 this.$.mirror.innerHTML = this._constrain(this.tokens); 231 this.$.mirror.innerHTML = this._constrain(this.tokens);
227 }, 232 },
228 233
229 _computeValue: function() { 234 _computeValue: function() {
230 return this.bindValue; 235 return this.bindValue;
231 } 236 }
232 }); 237 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698