This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
/
demo.html
92 lines (85 loc) · 3.09 KB
/
demo.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
<!DOCTYPE html>
<html>
<head>
<title>core-overlay</title>
<script src="../platform/platform.js"></script>
<link rel="import" href="../core-transition/core-transition-css.html">
<link rel="import" href="core-overlay.html">
<style>
.dialog {
box-sizing: border-box;
-moz-box-sizing: border-box;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
-webkit-user-select: none;
-moz-user-select: none;
overflow: hidden;
background: white;
padding:30px 42px;
outline: 1px solid rgba(0,0,0,0.2);
box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
#dialog {
width: 500px;
}
#confirmation {
text-align: center;
width: 150px;
}
</style>
</head>
<body unresolved>
<x-dialog id="dialog" class="dialog">
<h2>Dialog</h2>
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed fringilla sapien sed enim sollicitudin laoreet. Suspendisse suscipit, metus ac volutpat sodales, libero magna semper lacus, molestie fringilla massa orci ut arcu. Nullam sodales urna sit amet odio vehicula mattis.</div><br><br>
<div>Ut aliquam vulputate congue. Vestibulum pretium pretium nulla quis sollicitudin. Praesent lacinia congue erat nec mattis. Fusce commodo lacus est. Duis turpis eros, ultrices sed aliquet non, blandit egestas velit. Integer a augue nec lorem tristique hendrerit. Curabitur imperdiet risus id enim bibendum vestibulum. Integer id magna at arcu faucibus fermentum vel a augue. Sed fringilla venenatis dolor, in blandit magna molestie luctus. Vestibulum dignissim posuere ultrices. Aenean urna nisl, tincidunt vitae iaculis ut, pharetra nec eros.</div><br><br>
<div>
<input placeholder="say something..." autofocus oninput="somethingCheck(this)"></input><br>
I agree with this wholeheartedly.
<core-overlay id="confirmation" class="dialog" transition="core-transition-top">
Thank you.
</core-overlay>
</div><br><br>
<script>
function somethingCheck(e) {
if (e.value === 'something') {
document.getElementById('confirmation').toggle();
}
}
</script>
<button overlay-toggle>OK</button>
</x-dialog>
<button onclick="document.getElementById('dialog').toggle();">Toggle Dialog</button>
<polymer-element name="x-dialog" attributes="opened autoCloseDisabled">
<template>
<style>
:host {
box-sizing: border-box;
-moz-box-sizing: border-box;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
-webkit-user-select: none;
-moz-user-select: none;
overflow: hidden;
background: white;
padding:30px 42px;
outline: 1px solid rgba(0,0,0,0.2);
box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
</style>
<core-overlay id="overlay" opened="{{opened}}" autoCloseDisabled="{{autoCloseDisabled}}" transition="core-transition-center"></core-overlay>
<content></content>
</template>
<script>
Polymer('x-dialog', {
ready: function() {
this.$.overlay.target = this;
},
toggle: function() {
this.$.overlay.toggle();
}
});
</script>
</polymer-element>
</body>
</html>