-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
69 lines (62 loc) · 1.37 KB
/
index.html
File metadata and controls
69 lines (62 loc) · 1.37 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Elm filter list</title>
<script src="filter.js"></script>
<style>
body {
font-family: sans-serif;
font-size: 12px;
}
.filter-box {
width: 100%;
padding: 10px;
box-sizing: border-box;
}
.herblist {
max-height: 300px;
overflow-y: scroll;
border: 1px solid #eee;
}
.herblist-header {
width: 100%;
background: #f2f2f2;
color: #666;
}
.herblist-header span {
width: 50%;
padding: 10px;
box-sizing: border-box;
display: inline-block;
}
.list-item span {
width: calc(50% - 5px);
display: inline-block;
padding: 10px;
border: 1px solid #eee;
box-sizing: border-box;
}
</style>
</head>
<body>
<div id="list"></div>
<script>
var initModel = {
"herbs": [],
"filterBy": "",
"message": "init message",
"url": "http://localhost:3000/herbs"
};
var node = document.getElementById('list');
var app = Elm.ListFilter.embed(node, initModel);
setTimeout(function() {
var herblistContainer = node.getElementsByClassName('herblist')[0]
herblistContainer.addEventListener('scroll', function(e) {
// console.log(herblistContainer.scrollTop)
app.ports.offset.send(herblistContainer.scrollTop)
})
}, 0)
</script>
</body>
</html>