forked from JanMiksovsky/basic-list-box
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
116 lines (103 loc) · 2.74 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>basic-list-box</title>
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../basic-framed-content/basic-framed-content.html">
<link rel="import" href="basic-list-box.html">
<style>
body,
button,
input {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 15px;
}
body {
margin: 0;
}
basic-framed-content {
padding: 2em;
}
p {
max-width: 800px;
}
</style>
<script>
var changeDetectorAspect = {
contribute: {
set selectedItem(selectedItem) {
var text = selectedItem ? selectedItem.textContent : selectedItem;
console.log("selectedItem: " + text);
},
// TODO: On WebKit, if you delete an item at runtime, the number of items
// reported by the function below will be incorrect; it will include the
// just-deleted item in its count. It appears that, during the mutation
// handler, the old item is still somehow half in, half out of the
// collection of children/content/items.
itemsChanged: function() {
console.log("itemsChanged: now " + this.collective.items.length + " items");
}
}
};
document.addEventListener('WebComponentsReady', function() {
new Basic.Collective(changeDetectorAspect, document.querySelector('basic-list-box'));
document.body.removeAttribute('unresolved');
});
</script>
</head>
<body unresolved>
<basic-framed-content>
<p>
You can navigate this list with the standard keys — Up/Down, Page Up/Down,
Home/End — or by typing the beginning of a list item.
</p>
<basic-list-box aria-label="Fruits" style="height: 200px; max-width: 400px;">
<div>Acai</div>
<div>Acerola</div>
<div>Apple</div>
<div>Apricot</div>
<div>Banana</div>
<div>Blackberry</div>
<div>Blueberry</div>
<div>Cantaloupe</div>
<div>Cherry</div>
<div>Cranberry</div>
<div>Currant</div>
<div>Date</div>
<div>Durian</div>
<div>Fig</div>
<div>Goji berry</div>
<div>Gooseberry</div>
<div>Grape</div>
<div>Grapefruit</div>
<div>Honeydew</div>
<div>Jackfruit</div>
<div>Kiwi</div>
<div>Kumquat</div>
<div>Lemon</div>
<div>Lime</div>
<div>Lychee </div>
<div>Mango</div>
<div>Mangosteen</div>
<div>Mulberry</div>
<div>Nectarine</div>
<div>Orange</div>
<div>Papaya</div>
<div>Passion Fruit</div>
<div>Peach</div>
<div>Pear</div>
<div>Pineapple</div>
<div>Plum</div>
<div>Pomegranate</div>
<div>Pomelo</div>
<div>Prickly Pear</div>
<div>Raspberry</div>
<div>Strawberry</div>
<div>Tangerine</div>
<div>Watermelon</div>
</basic-list-box>
</basic-framed-content>
</body>
</html>