3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 Code distributed by Google as part of the polymer project is also
8 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
13 <title>core-overlay
</title>
14 <meta name=
"viewport" content=
"width=device-width, user-scalable=no">
15 <script src=
"../webcomponentsjs/webcomponents.js"></script>
16 <link rel=
"import" href=
"../core-transition/core-transition-css.html">
17 <link rel=
"import" href=
"core-overlay.html">
30 <x-container></x-container>
33 <!-- a simple dialog element made with core-overlay -->
34 <polymer-element name=
"x-dialog" attributes=
"opened autoCloseDisabled">
39 box-sizing: border-box;
40 -moz-box-sizing: border-box;
41 font-family: Arial, Helvetica, sans-serif;
43 -webkit-user-select: none;
44 -moz-user-select: none;
48 outline:
1px solid rgba(
0,
0,
0,
0.2);
49 box-shadow:
0 4px
16px rgba(
0,
0,
0,
0.2);
52 <core-overlay id=
"overlay" layered backdrop
opened=
"{{opened}}" autoCloseDisabled=
"{{autoCloseDisabled}}" transition=
"core-transition-center"></core-overlay>
60 this.$.overlay
.target
= this;
64 this.$.overlay
.toggle();
73 <!-- an element that uses the x-dialog element and core-overlay -->
74 <polymer-element name=
"x-container">
76 <x-dialog id=
"dialog" class=
"dialog">
77 <!-- place all overlay styles inside the overlay target -->
80 box-sizing: border-box;
81 -moz-box-sizing: border-box;
82 font-family: Arial, Helvetica, sans-serif;
84 -webkit-user-select: none;
85 -moz-user-select: none;
89 outline:
1px solid rgba(
0,
0,
0,
0.2);
90 box-shadow:
0 4px
16px rgba(
0,
0,
0,
0.2);
98 <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>
99 <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>
102 <input placeholder=
"say something..." autofocus
on-input=
"{{inputHandler}}" /><br>
103 I agree with this wholeheartedly.
104 <core-overlay layered
id=
"confirmation" class=
"dialog" backdrop
transition=
"core-transition-top">
105 <!-- place all overlay styles inside the overlay target -->
108 box-sizing: border-box;
109 -moz-box-sizing: border-box;
110 font-family: Arial, Helvetica, sans-serif;
112 -webkit-user-select: none;
113 -moz-user-select: none;
117 outline:
1px solid rgba(
0,
0,
0,
0.2);
118 box-shadow:
0 4px
16px rgba(
0,
0,
0,
0.2);
122 box-sizing: border-box;
130 <button core-overlay-toggle
>OK
</button>
133 <button on-tap=
"{{tapHandler}}">Toggle Dialog
</button>
137 Polymer('x-container', {
139 inputHandler: function(e
) {
140 if (e
.target
.value
=== 'something') {
141 this.$.confirmation
.toggle();
145 tapHandler: function() {
146 this.$.dialog
.toggle();