forked from mozbrick/brick-dialog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
108 lines (96 loc) · 3.15 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<title>brick-dialog</title>
<!-- Importing Polyfill -->
<script src="bower_components/platform/platform.js"></script>
<!-- Importing Custom Elemenent -->
<link rel="import" href="dist/brick-dialog.local.html">
<link rel="import" href="bower_components/brick-action/dist/brick-action.html">
<link rel="import" href="bower_components/brick-input/dist/brick-input.html">
<style type="text/css">
body {
font-family: sans-serif;
font-size: 17px;
}
</style>
</head>
<body>
<!-- Using Custom Element -->
<h3>Brick dialog</h3>
<brick-action target="horizontal" action="show">
<button>vertical options with brick-action</button>
</brick-action>
<button onclick="showDialog('vertical')">vertical options with onclick</button>
<brick-action target="controls" action="show">
<button>controls</button>
</brick-action>
<brick-action target="input" action="show">
<button>input dialog</button>
</brick-action>
<brick-dialog id="horizontal">
<header><h1>This is the header</h1></header>
<section center>
Are you sure you want to delete this?
</section>
<footer>
<brick-action target="horizontal" action="hide">
<button>cancel</button>
</brick-action>
<brick-action target="horizontal" action="hide">
<button>open</button>
</brick-action>
</footer>
</brick-dialog>
<brick-dialog id="vertical">
<section center>
<p>Are you sure you want to delete this?</p>
</section>
<footer vertical>
<button onclick="hideDialog('vertical')">cancel</button>
<button onclick="hideDialog('vertical')">open</button>
</footer>
</brick-dialog>
<brick-dialog id="controls">
<footer vertical>
<brick-action target="controls" action="hide">
<button>one</button>
</brick-action>
<brick-action target="controls" action="hide">
<button>two</button>
</brick-action>
<brick-action target="controls" action="hide">
<button>three</button>
</brick-action>
<brick-action target="controls" action="hide">
<button>four</button>
</brick-action>
<brick-action target="controls" action="hide">
<button>five</button>
</brick-action>
</footer>
</brick-dialog>
<brick-dialog id="input">
<section>
<brick-input label="hello" placeholder="example"></brick-input>
</section>
<footer vertical>
<brick-action target="input" action="hide">
<button>send</button>
</brick-action>
</footer>
</brick-dialog>
<script type="text/javascript">
function showDialog(dialog_id) {
var dialog = document.getElementById(dialog_id)
dialog.show()
}
function hideDialog(dialog_id) {
var dialog = document.getElementById(dialog_id)
dialog.hide()
}
</script>
</body>
</html>