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

Side by Side Diff: third_party/polymer/v1_0/components-chromium/paper-input/paper-input-char-counter-extracted.js

Issue 1336623003: [MD settings] updating polymer to 1.1.13 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed Polymer.IronCheckedElementBehavior name Created 5 years, 3 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 (function() { 1 Polymer({
2
3 Polymer({
4
5 is: 'paper-input-char-counter', 2 is: 'paper-input-char-counter',
6 3
7 behaviors: [ 4 behaviors: [
8 Polymer.PaperInputAddonBehavior 5 Polymer.PaperInputAddonBehavior
9 ], 6 ],
10 7
11 properties: { 8 properties: {
12
13 _charCounterStr: { 9 _charCounterStr: {
14 type: String, 10 type: String,
15 value: '0' 11 value: '0'
16 } 12 }
17
18 }, 13 },
19 14
20 update: function(state) { 15 update: function(state) {
21 if (!state.inputElement) { 16 if (!state.inputElement) {
22 return; 17 return;
23 } 18 }
24 19
25 state.value = state.value || ''; 20 state.value = state.value || '';
26 21
27 // Account for the textarea's new lines. 22 // Account for the textarea's new lines.
28 var str = state.value.replace(/(\r\n|\n|\r)/g, '--').length; 23 var str = state.value.replace(/(\r\n|\n|\r)/g, '--').length;
29 24
30 if (state.inputElement.hasAttribute('maxlength')) { 25 if (state.inputElement.hasAttribute('maxlength')) {
31 str += '/' + state.inputElement.getAttribute('maxlength'); 26 str += '/' + state.inputElement.getAttribute('maxlength');
32 } 27 }
33 this._charCounterStr = str; 28 this._charCounterStr = str;
34 } 29 }
35 30 });
36 });
37
38 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698