-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdemo.html
More file actions
40 lines (37 loc) · 846 Bytes
/
demo.html
File metadata and controls
40 lines (37 loc) · 846 Bytes
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
<!doctype html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="modal/modal.css" />
<link rel="stylesheet" href="modal/modal-animation.css" />
<link rel="stylesheet" href="modal/modal-skin.css" />
</head>
<body>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mithril/0.1.22/mithril.js"></script>
<script src="modal/modal.js"></script>
<script>
//top level
var demo = {
controller: function() {
this.modal = submodule(Modal)
},
view: function(ctrl) {
return [
m("button[type=button]", {onclick: Modal.module.bind(this, inner)}, "Click to show modal"),
ctrl.modal({class: "modal-animation-8"})
]
}
}
//to be rendered in the modal
var inner = {
controller: function() {},
view: function() {
return [
m("h1", "Hello world")
]
}
}
m.module(document.body, demo)
</script>
</body>
</html>