3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.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/CONTRIBUTORS.txt
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/PATENTS.txt
12 <title>core-list
</title>
13 <meta name=
"viewport" content=
"width=device-width">
14 <script src=
"../platform/platform.js"></script>
15 <link rel=
"import" href=
"core-list.html">
30 background: red !important;
31 border-bottom:
1px solid black;
37 <list-test></list-test>
39 <polymer-element name=
"list-test">
47 box-sizing: border-box;
49 border-bottom:
1px solid #ddd;
52 background-color: white;
63 background-repeat: no-repeat;
64 background-position:
10px
10px;
65 background-size:
60px;
83 <core-list id=
"list" data=
"{{data}}" height=
"80">
85 <div class=
"item {{ {selected: selected} | tokenList }}">
86 <div class=
"message" style=
"background-image: url(images/{{index % 4}}.png);">
87 <span class=
"from">{{name}}
</span>
88 <span class=
"timestamp">{{time}}
</span>
89 <div class=
"subject">Infinite List. {{index}}
</div>
90 <div class=
"body">{{details}}
</div>
101 "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...",
102 "Lorem Ipsum is simply dummy text of the printing and typesetting industry."
106 generateString: function(inLength
) {
108 for (var i
=0; i
<inLength
; i
++) {
109 s
+= String
.fromCharCode(Math
.floor(Math
.random() * 26) + 97);
113 generateName: function(inMin
, inMax
) {
114 return this.generateString(Math
.floor(Math
.random() * (inMax
- inMin
+ 1) + inMin
));
118 Polymer('list-test', {
121 this.data
= this.generateData();
123 generateData: function() {
124 var names
= [], data
= [];
125 for (var i
=0; i
<this.count
; i
++) {
126 names
.push(namegen
.generateName(4, 8));
129 for (var i
=0; i
<this.count
; i
++) {
131 var divider
= name
.charAt(0);
132 if (divider
=== (names
[i
-1] || '').charAt(0)) {
139 details
: strings
[i
% 3],
145 tapAction: function(e
) {
146 console
.log('tap', e
);