-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
89 lines (77 loc) · 2.39 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
<!DOCTYPE html>
<html>
<head>
<title>TaoDialog</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link media="all" rel="stylesheet" type="text/css" href="dist/tao.css">
<link media="all" rel="stylesheet" type="text/css" href="dist/tao_dialog.css">
<style>
.wrapper {
width: 800px;
height: 600px;
position: relative;
margin: 80px auto;
}
.tao-dialog-content {
padding: 40px;
}
</style>
<script type="text/javascript" src="dist/tao.js"></script>
<script type="text/javascript" src="dist/tao_dialog.js"></script>
</head>
<body>
<div class="wrapper">
<tao-dialog>
<div class="tao-dialog-wrapper">
<div class="tao-dialog-content">
<p>show dialog unless active attribute is false.</p>
<div class="buttons">
<button type="button" class="close-dialog">Close</button>
</div>
</div>
</div>
</tao-dialog>
<button type="button" class="button-show-dialog">
show dialog
</button>
<label>
maskCloseable
<input type="checkbox" class="input-mask-closeable" checked>
</label>
<label>
destroyOnClose
<input type="checkbox" class="input-destroy-on-close">
</label>
<tao-dialog active="false" class="demo-dialog">
<div class="tao-dialog-wrapper">
<div class="tao-dialog-content">
<p>basic modal</p>
<div class="buttons">
<button type="button" class="close-dialog">Close</button>
</div>
</div>
</div>
</tao-dialog>
<script type="text/javascript">
var $demoDialog = $('.demo-dialog').clone();
$('.button-show-dialog').on('click', function() {
demoDialog = $('.demo-dialog').get(0);
if (!demoDialog) {
demoDialog = $demoDialog.clone()
.attr('mask-closeable', $('.input-mask-closeable').is(':checked'))
.attr('destroy-on-close', $('.input-destroy-on-close').is(':checked'))
.appendTo($('.wrapper')).get(0);
}
demoDialog.show();
});
$('.input-mask-closeable').on('change', function() {
$('.demo-dialog').attr('mask-closeable', $(this).is(':checked'))
});
$('.input-destroy-on-close').on('change', function() {
$('.demo-dialog').attr('destroy-on-close', $(this).is(':checked'))
});
</script>
</div>
</body>
</html>