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