Remove LOAD_SUB_FRAME load flag.
[chromium-blink-merge.git] / third_party / polymer / components / core-dropdown-menu / demo.html
blobf2646e5bf809fdc6950153f27055786884b0c3d7
1 <!doctype html>
2 <!--
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 -->
11 <html>
12 <head>
14 <meta charset="utf-8">
15 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
16 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
18 <title>core-dropdown-menu</title>
20 <script src="../webcomponentsjs/webcomponents.js"></script>
22 <link href="../core-collapse/core-collapse.html" rel="import">
23 <link href="../core-dropdown/core-dropdown.html" rel="import">
24 <link href="../core-icons/core-icons.html" rel="import">
25 <link href="../core-icon-button/core-icon-button.html" rel="import">
26 <link href="../core-item/core-item.html" rel="import">
27 <link href="../core-menu/core-menu.html" rel="import">
29 <link href="core-dropdown-menu.html" rel="import">
31 <style shim-shadowdom>
32 body {
33 font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
34 font-size: 14px;
35 margin: 0;
36 padding: 24px;
37 -webkit-tap-highlight-color: rgba(0,0,0,0);
38 -webkit-touch-callout: none;
41 section {
42 padding: 20px 0;
45 section > div {
46 padding: 14px;
47 font-size: 16px;
50 html /deep/ core-dropdown-menu {
51 box-sizing: border-box;
52 width: 170px;
55 html /deep/ core-dropdown {
56 box-sizing: border-box;
57 min-width: 170px;
58 background-color: #eee;
59 color: #000;
60 border: 1px solid #ccc;
61 border-radius: 3px;
64 core-item {
65 overflow: hidden;
66 white-space: nowrap;
67 text-overflow: ellipsis;
70 html /deep/ core-collapse {
71 border: 1px solid #ccc;
72 padding: 8px;
75 .constrained-height {
76 height: 150px;
79 .colored {
80 border: 1px solid #0f9d58;
81 background-color: #b7e1cd;
82 color: #0f9d58;
85 </style>
87 </head>
88 <body>
90 <template is="auto-binding">
92 <section>
94 <div>Absolutely positioned dropdowns</div>
96 <core-dropdown-menu label="Your favorite pastry">
97 <core-dropdown class="dropdown">
98 <core-menu>
99 <template repeat="{{pastries}}">
100 <core-item>{{}}</core-item>
101 </template>
102 </core-menu>
103 </core-dropdown>
104 </core-dropdown-menu>
106 <br><br>
108 <core-dropdown-menu label="Disabled" disabled>
109 <core-dropdown class="dropdown">
110 <core-menu>
111 <core-item>Should not see this</core-item>
112 </core-menu>
113 </core-dropdown>
114 </core-dropdown-menu>
116 </section>
118 <section>
120 <div>Layered dropdowns</div>
122 <button onclick="document.getElementById('collapse').toggle()">toggle core-collapse</button>
124 <br>
126 <core-collapse id="collapse">
128 <core-dropdown-menu label="Your favorite pastry">
129 <core-dropdown layered class="dropdown">
130 <core-menu>
131 <template repeat="{{pastries}}">
132 <core-item>{{}}</core-item>
133 </template>
134 </core-menu>
135 </core-dropdown>
136 </core-dropdown-menu>
138 </core-collapse>
140 </section>
142 <section>
144 <div>Custom styling</div>
146 <core-dropdown-menu label="Constrained height">
147 <core-dropdown class="dropdown constrained-height">
148 <core-menu>
149 <template repeat="{{pastries}}">
150 <core-item>{{}}</core-item>
151 </template>
152 </core-menu>
153 </core-dropdown>
154 </core-dropdown-menu>
156 <br><br>
158 <core-dropdown-menu label="Colored">
159 <core-dropdown class="dropdown colored">
160 <core-menu>
161 <template repeat="{{pastries}}">
162 <core-item>{{}}</core-item>
163 </template>
164 </core-menu>
165 </core-dropdown>
166 </core-dropdown-menu>
168 </section>
170 </template>
172 <script>
174 scope = document.querySelector('template[is=auto-binding]');
176 scope.pastries = [
177 'Apple fritter',
178 'Croissant',
179 'Donut',
180 'Financier',
181 'Jello',
182 'Madeleine',
183 'Pound cake',
184 'Pretzel',
185 'Sfogliatelle'
188 </script>
190 </body>
191 </html>