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

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

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

Powered by Google App Engine
This is Rietveld 408576698