forked from Geodan/LODUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
142 lines (123 loc) · 3.05 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!doctype html>
<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<title>core-list</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<script src="./bower_components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="./bower_components/polymer/polymer.html">
<link rel="import" href="./bower_components/core-list/core-list.html">
<style>
html, body {
margin: 0;
-webkit-tap-highlight-color: transparent;
overflow: hidden;
}
list-test {
display: block;
height: 100%;
margin: 0 auto;
}
.stuff {
min-height: 60px;
background: red !important;
border-bottom: 1px solid black;
}
</style>
</head>
<body fit>
<list-test></list-test>
<polymer-element name="list-test" layout vertical>
<template>
<style>
.item {
box-sizing: border-box;
height: 80px;
border-bottom: 1px solid #ddd;
padding: 4px;
cursor: default;
background-color: white;
overflow: hidden;
}
.selected {
background: silver;
}
.message {
padding-left: 77px;
line-height: 167%;
background-repeat: no-repeat;
background-position: 10px 10px;
background-size: 60px;
}
.from {
display: inline;
font-weight: bold;
}
.timestamp {
margin-left: 10px;
font-size: 12px;
opacity: 0.8;
}
.body {
font-size: 12px;
}
.spaced {
margin: 10px;
}
.selection-display {
background: lightgray;
padding: 0 5px;
margin: 0 5px;
}
.narrow {
width: 40px;
}
</style>
<div class="spaced">
TESKDJSHKJGHKJWREHGKJHG
</div>
<div layout horizontal wrap class="spaced">
Selected values:
</div>
<core-list id="list" data="{{data}}" selectionEnabled="{{selectionEnabled}}"
selection="{{selection}}" height="80" flex multi?={{multi}}>
<template>
<div class="item {{ {selected: selected} | tokenList }}">
<div class="message">
<span class="from">{{model.name}}</span>
</div>
</div>
</template>
</core-list>
</template>
<script>
(function() {
Polymer({
addIdx: 0,
deleteIdx: 0,
count: 50000,
ready: function() {
this.data = [];
window.list = this.$.list;
this.generateData();
},
generateData: function() {
var names = [], data = [];
for (var i=0; i<this.count; i++) {
names.push({name: 'test'+i});
}
this.data = names;
}
});
})();
</script>
</polymer-element>
</body>
</html>