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: divider
</title>
13 <meta name=
"viewport" content=
"width=device-width">
14 <script src=
"../platform/platform.js"></script>
15 <link rel=
"import" href=
"core-list.html">
18 font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
31 background: red !important;
32 border-bottom:
1px solid black;
38 <list-test></list-test>
40 <polymer-element name=
"list-test">
48 box-sizing: border-box;
50 border-bottom:
1px solid #ddd;
62 background-repeat: no-repeat;
63 background-position:
10px
10px;
64 background-size:
60px;
88 box-sizing: border-box;
89 box-shadow: inset
0 8px
40px
0 rgba(
0,
0,
0,
0.1);
90 text-transform: uppercase;
97 background-color: white;
100 <core-list id=
"list" data=
"{{data}}" height=
"80">
102 <div class=
"item {{ {selected: selected} | tokenList }}">
103 <div class=
"divider {{ {hidden: !divider} |tokenList}}">{{divider}}
</div>
104 <div class=
"message {{ {hidden: divider} |tokenList}}" style=
"background-image: url(images/{{index % 4}}.png);">
105 <span class=
"from">{{name}}
</span>
106 <span class=
"timestamp">{{time}}
</span>
107 <div class=
"subject">Infinite List. {{index}}
</div>
108 <div class=
"body">{{details}}
</div>
119 "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...",
120 "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."
124 generateString: function(inLength
) {
126 for (var i
=0; i
<inLength
; i
++) {
127 s
+= String
.fromCharCode(Math
.floor(Math
.random() * 26) + 97);
131 generateName: function(inMin
, inMax
) {
132 return this.generateString(Math
.floor(Math
.random() * (inMax
- inMin
+ 1) + inMin
));
136 Polymer('list-test', {
139 this.data
= this.generateData();
141 generateData: function() {
142 var names
= [], data
= [];
143 for (var i
=0; i
<this.count
; i
++) {
144 names
.push(namegen
.generateName(4, 8));
147 for (var i
=0, o
; i
<this.count
; i
++) {
149 var divider
= name
.charAt(0);
150 if (divider
=== (names
[i
-1] || '').charAt(0)) {
157 details
: strings
[i
% 3],
162 o
= Object
.create(o
);
169 tapAction: function(e
) {
170 console
.log('tap', e
);