Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components-chromium / paper-input / paper-input-char-counter-extracted.js
blob673f5e79bf900bea273f12f1a0569048f6213f9b
3 (function() {
5   Polymer({
7     is: 'paper-input-char-counter',
9     behaviors: [
10       Polymer.PaperInputAddonBehavior
11     ],
13     properties: {
15       _charCounterStr: {
16         type: String,
17         value: '0'
18       }
20     },
22     update: function(state) {
23       if (!state.inputElement) {
24         return;
25       }
27       state.value = state.value || '';
29       // Account for the textarea's new lines.
30       var str = state.value.replace(/(\r\n|\n|\r)/g, '--').length;
32       if (state.inputElement.hasAttribute('maxlength')) {
33         str += '/' + state.inputElement.getAttribute('maxlength');
34       }
35       this._charCounterStr = str;
36     }
38   });
40 })();