| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 @license | 2 @license |
| 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 --> | 9 --> |
| 10 | 10 |
| 11 <link rel="import" href="../polymer/polymer.html"> | 11 <link rel="import" href="../polymer/polymer.html"> |
| 12 <link rel="import" href="../iron-behaviors/iron-control-state.html"> |
| 12 <link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html"> | 13 <link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html"> |
| 13 <link rel="import" href="../iron-validatable-behavior/iron-validatable-behavior.
html"> | 14 <link rel="import" href="../iron-validatable-behavior/iron-validatable-behavior.
html"> |
| 14 | 15 |
| 15 <!-- | 16 <!-- |
| 16 `iron-autogrow-textarea` is an element containing a textarea that grows in heigh
t as more | 17 `iron-autogrow-textarea` is an element containing a textarea that grows in heigh
t as more |
| 17 lines of input are entered. Unless an explicit height or the `maxRows` property
is set, it will | 18 lines of input are entered. Unless an explicit height or the `maxRows` property
is set, it will |
| 18 never scroll. | 19 never scroll. |
| 19 | 20 |
| 20 Example: | 21 Example: |
| 21 | 22 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 autofocus$="[[autofocus]]" | 79 autofocus$="[[autofocus]]" |
| 79 inputmode$="[[inputmode]]" | 80 inputmode$="[[inputmode]]" |
| 80 name$="[[name]]" | 81 name$="[[name]]" |
| 81 placeholder$="[[placeholder]]" | 82 placeholder$="[[placeholder]]" |
| 82 readonly$="[[readonly]]" | 83 readonly$="[[readonly]]" |
| 83 required$="[[required]]" | 84 required$="[[required]]" |
| 84 rows$="[[rows]]" | 85 rows$="[[rows]]" |
| 85 maxlength$="[[maxlength]]"></textarea> | 86 maxlength$="[[maxlength]]"></textarea> |
| 86 </div> | 87 </div> |
| 87 </template> | 88 </template> |
| 89 </dom-module> |
| 88 | 90 |
| 89 <script> | 91 <script> |
| 90 | 92 |
| 91 Polymer({ | 93 Polymer({ |
| 92 | 94 |
| 93 is: 'iron-autogrow-textarea', | 95 is: 'iron-autogrow-textarea', |
| 94 | 96 |
| 95 behaviors: [ | 97 behaviors: [ |
| 96 Polymer.IronValidatableBehavior | 98 Polymer.IronValidatableBehavior, |
| 99 Polymer.IronControlState |
| 97 ], | 100 ], |
| 98 | 101 |
| 99 properties: { | 102 properties: { |
| 100 | 103 |
| 101 /** | 104 /** |
| 102 * Use this property instead of `value` for two-way data binding. | 105 * Use this property instead of `value` for two-way data binding. |
| 103 */ | 106 */ |
| 104 bindValue: { | 107 bindValue: { |
| 105 observer: '_bindValueChanged', | 108 observer: '_bindValueChanged', |
| 106 type: String | 109 type: String |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 } | 257 } |
| 255 this.tokens = (input && input.value) ? input.value.replace(/&/gm, '&')
.replace(/"/gm, '"').replace(/'/gm, ''').replace(/</gm, '<').replace
(/>/gm, '>').split('\n') : ['']; | 258 this.tokens = (input && input.value) ? input.value.replace(/&/gm, '&')
.replace(/"/gm, '"').replace(/'/gm, ''').replace(/</gm, '<').replace
(/>/gm, '>').split('\n') : ['']; |
| 256 return this._constrain(this.tokens); | 259 return this._constrain(this.tokens); |
| 257 }, | 260 }, |
| 258 | 261 |
| 259 _updateCached: function() { | 262 _updateCached: function() { |
| 260 this.$.mirror.innerHTML = this._constrain(this.tokens); | 263 this.$.mirror.innerHTML = this._constrain(this.tokens); |
| 261 } | 264 } |
| 262 }) | 265 }) |
| 263 </script> | 266 </script> |
| OLD | NEW |