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

Side by Side Diff: third_party/polymer/v1_0/components-chromium/paper-input/paper-input-char-counter-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 Polymer({
3 is: 'paper-input-char-counter', 2 is: 'paper-input-char-counter',
4 3
5 behaviors: [ 4 behaviors: [
6 Polymer.PaperInputAddonBehavior 5 Polymer.PaperInputAddonBehavior
7 ], 6 ],
8 7
9 properties: { 8 properties: {
10 _charCounterStr: { 9 _charCounterStr: {
11 type: String, 10 type: String,
12 value: '0' 11 value: '0'
13 } 12 }
14 }, 13 },
15 14
16 update: function(state) { 15 update: function(state) {
17 if (!state.inputElement) { 16 if (!state.inputElement) {
18 return; 17 return;
19 } 18 }
20 19
21 state.value = state.value || ''; 20 state.value = state.value || '';
22 21
23 // Account for the textarea's new lines. 22 // Account for the textarea's new lines.
24 var str = state.value.replace(/(\r\n|\n|\r)/g, '--').length; 23 var str = state.value.replace(/(\r\n|\n|\r)/g, '--').length;
25 24
26 if (state.inputElement.hasAttribute('maxlength')) { 25 if (state.inputElement.hasAttribute('maxlength')) {
27 str += '/' + state.inputElement.getAttribute('maxlength'); 26 str += '/' + state.inputElement.getAttribute('maxlength');
28 } 27 }
29 this._charCounterStr = str; 28 this._charCounterStr = str;
30 } 29 }
31 }); 30 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698