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
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
</title>
20 <script src=
"../webcomponentsjs/webcomponents.js"></script>
22 <link href=
"../core-collapse/core-collapse.html" rel=
"import">
23 <link href=
"../core-icons/core-icons.html" rel=
"import">
24 <link href=
"../core-icon-button/core-icon-button.html" rel=
"import">
26 <link href=
"core-dropdown.html" rel=
"import">
28 <style shim-shadowdom
>
30 font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
34 -webkit-tap-highlight-color: rgba(
0,
0,
0,
0);
35 -webkit-touch-callout: none;
47 html /deep/ core-dropdown {
48 background-color: #eee;
50 border:
1px solid #ccc;
68 <polymer-element name=
"x-trigger" extends=
"core-icon-button" relative
on-tap=
"{{toggle}}">
73 this.dropdown
= this.querySelector('core-dropdown');
75 this.dropdown
&& this.dropdown
.toggle();
81 <template is=
"auto-binding">
85 <div>Absolutely positioned dropdowns
</div>
87 <x-trigger icon=
"menu">
95 <x-trigger icon=
"menu">
96 <core-dropdown valign=
"bottom">
103 <x-trigger icon=
"menu">
104 <core-dropdown halign=
"right">
115 <div>Layered dropdowns
</div>
117 <button onclick=
"document.getElementById('collapse').toggle()">toggle core-collapse
</button>
121 <core-collapse id=
"collapse">
123 <x-trigger icon=
"menu">
124 <core-dropdown layered
>
137 <div>Scrolling and margin
</div>
139 <x-trigger icon=
"menu">
143 <template repeat=
"{{countries}}">
149 <x-trigger icon=
"menu">
150 <core-dropdown class=
"with-margin">
153 <template repeat=
"{{countries}}">
163 <div>Custom position
</div>
165 <x-trigger icon=
"menu">
166 <core-dropdown class=
"open-below">
177 scope
= document
.querySelector('template[is=auto-binding]');
180 {name
: 'Afghanistan', code
: 'AF'},
181 {name
: 'Ă…land Islands', code
: 'AX'},
182 {name
: 'Albania', code
: 'AL'},
183 {name
: 'Algeria', code
: 'DZ'},
184 {name
: 'American Samoa', code
: 'AS'},
185 {name
: 'Andorra', code
: 'AD'},
186 {name
: 'Angola', code
: 'AO'},
187 {name
: 'Anguilla', code
: 'AI'},
188 {name
: 'Antarctica', code
: 'AQ'},
189 {name
: 'Antigua and Barbuda', code
: 'AG'},
190 {name
: 'Argentina', code
: 'AR'},
191 {name
: 'Armenia', code
: 'AM'},
192 {name
: 'Aruba', code
: 'AW'},
193 {name
: 'Australia', code
: 'AU'},
194 {name
: 'Austria', code
: 'AT'},
195 {name
: 'Azerbaijan', code
: 'AZ'},
196 {name
: 'Bahamas', code
: 'BS'},
197 {name
: 'Bahrain', code
: 'BH'},
198 {name
: 'Bangladesh', code
: 'BD'},
199 {name
: 'Barbados', code
: 'BB'},
200 {name
: 'Belarus', code
: 'BY'},
201 {name
: 'Belgium', code
: 'BE'},
202 {name
: 'Belize', code
: 'BZ'},
203 {name
: 'Benin', code
: 'BJ'},
204 {name
: 'Bermuda', code
: 'BM'},
205 {name
: 'Bhutan', code
: 'BT'},
206 {name
: 'Bolivia', code
: 'BO'},
207 {name
: 'Bosnia and Herzegovina', code
: 'BA'},
208 {name
: 'Botswana', code
: 'BW'},
209 {name
: 'Bouvet Island', code
: 'BV'},
210 {name
: 'Brazil', code
: 'BR'},
211 {name
: 'British Indian Ocean Territory', code
: 'IO'},
212 {name
: 'Brunei Darussalam', code
: 'BN'},
213 {name
: 'Bulgaria', code
: 'BG'},
214 {name
: 'Burkina Faso', code
: 'BF'},
215 {name
: 'Burundi', code
: 'BI'},
216 {name
: 'Cambodia', code
: 'KH'},
217 {name
: 'Cameroon', code
: 'CM'},
218 {name
: 'Canada', code
: 'CA'},
219 {name
: 'Cape Verde', code
: 'CV'},
220 {name
: 'Cayman Islands', code
: 'KY'},
221 {name
: 'Central African Republic', code
: 'CF'},
222 {name
: 'Chad', code
: 'TD'},
223 {name
: 'Chile', code
: 'CL'},
224 {name
: 'China', code
: 'CN'},
225 {name
: 'Christmas Island', code
: 'CX'},
226 {name
: 'Cocos (Keeling) Islands', code
: 'CC'},
227 {name
: 'Colombia', code
: 'CO'},
228 {name
: 'Comoros', code
: 'KM'},
229 {name
: 'Congo', code
: 'CG'},
230 {name
: 'Congo, The Democratic Republic of the', code
: 'CD'},
231 {name
: 'Cook Islands', code
: 'CK'},
232 {name
: 'Costa Rica', code
: 'CR'},
233 {name
: 'Cote D\'Ivoire', code
: 'CI'},
234 {name
: 'Croatia', code
: 'HR'},
235 {name
: 'Cuba', code
: 'CU'},
236 {name
: 'Cyprus', code
: 'CY'},
237 {name
: 'Czech Republic', code
: 'CZ'},
238 {name
: 'Denmark', code
: 'DK'},
239 {name
: 'Djibouti', code
: 'DJ'},
240 {name
: 'Dominica', code
: 'DM'},
241 {name
: 'Dominican Republic', code
: 'DO'},
242 {name
: 'Ecuador', code
: 'EC'},
243 {name
: 'Egypt', code
: 'EG'},
244 {name
: 'El Salvador', code
: 'SV'},
245 {name
: 'Equatorial Guinea', code
: 'GQ'},
246 {name
: 'Eritrea', code
: 'ER'},
247 {name
: 'Estonia', code
: 'EE'},
248 {name
: 'Ethiopia', code
: 'ET'},
249 {name
: 'Falkland Islands (Malvinas)', code
: 'FK'},
250 {name
: 'Faroe Islands', code
: 'FO'},
251 {name
: 'Fiji', code
: 'FJ'},
252 {name
: 'Finland', code
: 'FI'},
253 {name
: 'France', code
: 'FR'},
254 {name
: 'French Guiana', code
: 'GF'},
255 {name
: 'French Polynesia', code
: 'PF'},
256 {name
: 'French Southern Territories', code
: 'TF'},
257 {name
: 'Gabon', code
: 'GA'},
258 {name
: 'Gambia', code
: 'GM'},
259 {name
: 'Georgia', code
: 'GE'},
260 {name
: 'Germany', code
: 'DE'},
261 {name
: 'Ghana', code
: 'GH'},
262 {name
: 'Gibraltar', code
: 'GI'},
263 {name
: 'Greece', code
: 'GR'},
264 {name
: 'Greenland', code
: 'GL'},
265 {name
: 'Grenada', code
: 'GD'},
266 {name
: 'Guadeloupe', code
: 'GP'},
267 {name
: 'Guam', code
: 'GU'},
268 {name
: 'Guatemala', code
: 'GT'},
269 {name
: 'Guernsey', code
: 'GG'},
270 {name
: 'Guinea', code
: 'GN'},
271 {name
: 'Guinea-Bissau', code
: 'GW'},
272 {name
: 'Guyana', code
: 'GY'},
273 {name
: 'Haiti', code
: 'HT'},
274 {name
: 'Heard Island and Mcdonald Islands', code
: 'HM'},
275 {name
: 'Holy See (Vatican City State)', code
: 'VA'},
276 {name
: 'Honduras', code
: 'HN'},
277 {name
: 'Hong Kong', code
: 'HK'},
278 {name
: 'Hungary', code
: 'HU'},
279 {name
: 'Iceland', code
: 'IS'},
280 {name
: 'India', code
: 'IN'},
281 {name
: 'Indonesia', code
: 'ID'},
282 {name
: 'Iran, Islamic Republic Of', code
: 'IR'},
283 {name
: 'Iraq', code
: 'IQ'},
284 {name
: 'Ireland', code
: 'IE'},
285 {name
: 'Isle of Man', code
: 'IM'},
286 {name
: 'Israel', code
: 'IL'},
287 {name
: 'Italy', code
: 'IT'},
288 {name
: 'Jamaica', code
: 'JM'},
289 {name
: 'Japan', code
: 'JP'},
290 {name
: 'Jersey', code
: 'JE'},
291 {name
: 'Jordan', code
: 'JO'},
292 {name
: 'Kazakhstan', code
: 'KZ'},
293 {name
: 'Kenya', code
: 'KE'},
294 {name
: 'Kiribati', code
: 'KI'},
295 {name
: 'Korea, Democratic People\'S Republic of', code
: 'KP'},
296 {name
: 'Korea, Republic of', code
: 'KR'},
297 {name
: 'Kuwait', code
: 'KW'},
298 {name
: 'Kyrgyzstan', code
: 'KG'},
299 {name
: 'Lao People\'S Democratic Republic', code
: 'LA'},
300 {name
: 'Latvia', code
: 'LV'},
301 {name
: 'Lebanon', code
: 'LB'},
302 {name
: 'Lesotho', code
: 'LS'},
303 {name
: 'Liberia', code
: 'LR'},
304 {name
: 'Libyan Arab Jamahiriya', code
: 'LY'},
305 {name
: 'Liechtenstein', code
: 'LI'},
306 {name
: 'Lithuania', code
: 'LT'},
307 {name
: 'Luxembourg', code
: 'LU'},
308 {name
: 'Macao', code
: 'MO'},
309 {name
: 'Macedonia, The Former Yugoslav Republic of', code
: 'MK'},
310 {name
: 'Madagascar', code
: 'MG'},
311 {name
: 'Malawi', code
: 'MW'},
312 {name
: 'Malaysia', code
: 'MY'},
313 {name
: 'Maldives', code
: 'MV'},
314 {name
: 'Mali', code
: 'ML'},
315 {name
: 'Malta', code
: 'MT'},
316 {name
: 'Marshall Islands', code
: 'MH'},
317 {name
: 'Martinique', code
: 'MQ'},
318 {name
: 'Mauritania', code
: 'MR'},
319 {name
: 'Mauritius', code
: 'MU'},
320 {name
: 'Mayotte', code
: 'YT'},
321 {name
: 'Mexico', code
: 'MX'},
322 {name
: 'Micronesia, Federated States of', code
: 'FM'},
323 {name
: 'Moldova, Republic of', code
: 'MD'},
324 {name
: 'Monaco', code
: 'MC'},
325 {name
: 'Mongolia', code
: 'MN'},
326 {name
: 'Montserrat', code
: 'MS'},
327 {name
: 'Morocco', code
: 'MA'},
328 {name
: 'Mozambique', code
: 'MZ'},
329 {name
: 'Myanmar', code
: 'MM'},
330 {name
: 'Namibia', code
: 'NA'},
331 {name
: 'Nauru', code
: 'NR'},
332 {name
: 'Nepal', code
: 'NP'},
333 {name
: 'Netherlands', code
: 'NL'},
334 {name
: 'Netherlands Antilles', code
: 'AN'},
335 {name
: 'New Caledonia', code
: 'NC'},
336 {name
: 'New Zealand', code
: 'NZ'},
337 {name
: 'Nicaragua', code
: 'NI'},
338 {name
: 'Niger', code
: 'NE'},
339 {name
: 'Nigeria', code
: 'NG'},
340 {name
: 'Niue', code
: 'NU'},
341 {name
: 'Norfolk Island', code
: 'NF'},
342 {name
: 'Northern Mariana Islands', code
: 'MP'},
343 {name
: 'Norway', code
: 'NO'},
344 {name
: 'Oman', code
: 'OM'},
345 {name
: 'Pakistan', code
: 'PK'},
346 {name
: 'Palau', code
: 'PW'},
347 {name
: 'Palestinian Territory, Occupied', code
: 'PS'},
348 {name
: 'Panama', code
: 'PA'},
349 {name
: 'Papua New Guinea', code
: 'PG'},
350 {name
: 'Paraguay', code
: 'PY'},
351 {name
: 'Peru', code
: 'PE'},
352 {name
: 'Philippines', code
: 'PH'},
353 {name
: 'Pitcairn', code
: 'PN'},
354 {name
: 'Poland', code
: 'PL'},
355 {name
: 'Portugal', code
: 'PT'},
356 {name
: 'Puerto Rico', code
: 'PR'},
357 {name
: 'Qatar', code
: 'QA'},
358 {name
: 'Reunion', code
: 'RE'},
359 {name
: 'Romania', code
: 'RO'},
360 {name
: 'Russian Federation', code
: 'RU'},
361 {name
: 'RWANDA', code
: 'RW'},
362 {name
: 'Saint Helena', code
: 'SH'},
363 {name
: 'Saint Kitts and Nevis', code
: 'KN'},
364 {name
: 'Saint Lucia', code
: 'LC'},
365 {name
: 'Saint Pierre and Miquelon', code
: 'PM'},
366 {name
: 'Saint Vincent and the Grenadines', code
: 'VC'},
367 {name
: 'Samoa', code
: 'WS'},
368 {name
: 'San Marino', code
: 'SM'},
369 {name
: 'Sao Tome and Principe', code
: 'ST'},
370 {name
: 'Saudi Arabia', code
: 'SA'},
371 {name
: 'Senegal', code
: 'SN'},
372 {name
: 'Serbia and Montenegro', code
: 'CS'},
373 {name
: 'Seychelles', code
: 'SC'},
374 {name
: 'Sierra Leone', code
: 'SL'},
375 {name
: 'Singapore', code
: 'SG'},
376 {name
: 'Slovakia', code
: 'SK'},
377 {name
: 'Slovenia', code
: 'SI'},
378 {name
: 'Solomon Islands', code
: 'SB'},
379 {name
: 'Somalia', code
: 'SO'},
380 {name
: 'South Africa', code
: 'ZA'},
381 {name
: 'South Georgia and the South Sandwich Islands', code
: 'GS'},
382 {name
: 'Spain', code
: 'ES'},
383 {name
: 'Sri Lanka', code
: 'LK'},
384 {name
: 'Sudan', code
: 'SD'},
385 {name
: 'Suriname', code
: 'SR'},
386 {name
: 'Svalbard and Jan Mayen', code
: 'SJ'},
387 {name
: 'Swaziland', code
: 'SZ'},
388 {name
: 'Sweden', code
: 'SE'},
389 {name
: 'Switzerland', code
: 'CH'},
390 {name
: 'Syrian Arab Republic', code
: 'SY'},
391 {name
: 'Taiwan, Province of China', code
: 'TW'},
392 {name
: 'Tajikistan', code
: 'TJ'},
393 {name
: 'Tanzania, United Republic of', code
: 'TZ'},
394 {name
: 'Thailand', code
: 'TH'},
395 {name
: 'Timor-Leste', code
: 'TL'},
396 {name
: 'Togo', code
: 'TG'},
397 {name
: 'Tokelau', code
: 'TK'},
398 {name
: 'Tonga', code
: 'TO'},
399 {name
: 'Trinidad and Tobago', code
: 'TT'},
400 {name
: 'Tunisia', code
: 'TN'},
401 {name
: 'Turkey', code
: 'TR'},
402 {name
: 'Turkmenistan', code
: 'TM'},
403 {name
: 'Turks and Caicos Islands', code
: 'TC'},
404 {name
: 'Tuvalu', code
: 'TV'},
405 {name
: 'Uganda', code
: 'UG'},
406 {name
: 'Ukraine', code
: 'UA'},
407 {name
: 'United Arab Emirates', code
: 'AE'},
408 {name
: 'United Kingdom', code
: 'GB'},
409 {name
: 'United States', code
: 'US'},
410 {name
: 'United States Minor Outlying Islands', code
: 'UM'},
411 {name
: 'Uruguay', code
: 'UY'},
412 {name
: 'Uzbekistan', code
: 'UZ'},
413 {name
: 'Vanuatu', code
: 'VU'},
414 {name
: 'Venezuela', code
: 'VE'},
415 {name
: 'Viet Nam', code
: 'VN'},
416 {name
: 'Virgin Islands, British', code
: 'VG'},
417 {name
: 'Virgin Islands, U.S.', code
: 'VI'},
418 {name
: 'Wallis and Futuna', code
: 'WF'},
419 {name
: 'Western Sahara', code
: 'EH'},
420 {name
: 'Yemen', code
: 'YE'},
421 {name
: 'Zambia', code
: 'ZM'},
422 {name
: 'Zimbabwe', code
: 'ZW'}