Update {virtual,override,final} to follow C++11 style.
[chromium-blink-merge.git] / third_party / polymer / components-chromium / core-overlay / demo.html
blob70331329366bd95a195e36279ba8b13e64eb4042
1 <!--
2 @license
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
9 -->
10 <!DOCTYPE html>
11 <html>
12 <head>
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">
18 <style>
19 body {
20 margin: 0;
23 section {
24 padding: 24px;
26 </style>
27 </head>
28 <body unresolved>
29 <section>
30 <x-container></x-container>
31 </section>
33 <!-- a simple dialog element made with core-overlay -->
34 <polymer-element name="x-dialog" attributes="opened autoCloseDisabled">
35 <template>
36 <style>
38 :host {
39 box-sizing: border-box;
40 -moz-box-sizing: border-box;
41 font-family: Arial, Helvetica, sans-serif;
42 font-size: 13px;
43 -webkit-user-select: none;
44 -moz-user-select: none;
45 overflow: hidden;
46 background: white;
47 padding:30px 42px;
48 outline: 1px solid rgba(0,0,0,0.2);
49 box-shadow: 0 4px 16px rgba(0,0,0,0.2);
51 </style>
52 <core-overlay id="overlay" layered backdrop opened="{{opened}}" autoCloseDisabled="{{autoCloseDisabled}}" transition="core-transition-center"></core-overlay>
53 <content></content>
54 </template>
55 <script>
57 Polymer('x-dialog', {
59 ready: function() {
60 this.$.overlay.target = this;
63 toggle: function() {
64 this.$.overlay.toggle();
67 });
69 </script>
70 </polymer-element>
73 <!-- an element that uses the x-dialog element and core-overlay -->
74 <polymer-element name="x-container">
75 <template>
76 <x-dialog id="dialog" class="dialog">
77 <!-- place all overlay styles inside the overlay target -->
78 <style no-shim>
79 .dialog {
80 box-sizing: border-box;
81 -moz-box-sizing: border-box;
82 font-family: Arial, Helvetica, sans-serif;
83 font-size: 13px;
84 -webkit-user-select: none;
85 -moz-user-select: none;
86 overflow: hidden;
87 background: white;
88 padding:30px 42px;
89 outline: 1px solid rgba(0,0,0,0.2);
90 box-shadow: 0 4px 16px rgba(0,0,0,0.2);
93 #dialog {
94 width: 500px;
96 </style>
97 <h2>Dialog</h2>
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>
101 <div>
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 -->
106 <style no-shim>
107 .dialog {
108 box-sizing: border-box;
109 -moz-box-sizing: border-box;
110 font-family: Arial, Helvetica, sans-serif;
111 font-size: 13px;
112 -webkit-user-select: none;
113 -moz-user-select: none;
114 overflow: hidden;
115 background: white;
116 padding:30px 42px;
117 outline: 1px solid rgba(0,0,0,0.2);
118 box-shadow: 0 4px 16px rgba(0,0,0,0.2);
121 #confirmation {
122 box-sizing: border-box;
123 text-align: center;
124 width: 150px;
126 </style>
127 Thank you.
128 </core-overlay>
129 </div><br><br>
130 <button core-overlay-toggle>OK</button>
131 </x-dialog>
133 <button on-tap="{{tapHandler}}">Toggle Dialog</button>
134 </template>
135 <script>
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();
151 </script>
152 </polymer-element>
154 </body>
155 </html>