Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / webui / resources / cr_elements / cr_dropdown_menu / cr_dropdown_menu.js
blob9f3342ae075fd88740b418425dab6141d2ad1744
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 /**
6 * @fileoverview
7 * `cr-dropdown-menu` is a Chrome-specific wrapper around paper-dropdown-menu.
8 * It includes a paper-dropdown so its content should just be a core-menu and
9 * items.
11 * Example:
12 * <cr-dropdown-menu>
13 * <core-menu>
14 * <paper-item>Chrome</paper-item>
15 * <paper-item>Firefox</paper-item>
16 * <paper-item>IE</paper-item>
17 * <paper-item>Opera</paper-item>
18 * </core-menu>
19 * </cr-dropdown-menu>
21 * @group Chrome Elements
22 * @element cr-dropdown-menu
25 Polymer('cr-dropdown-menu', {
26 publish: {
27 /**
28 * True if the menu is open.
30 * @attribute opened
31 * @type boolean
32 * @default false
34 opened: false,
36 /**
37 * A label for the control. The label is displayed if no item is selected.
39 * @attribute label
40 * @type string
41 * @default '<Dropdown Menu Label>'
43 label: '<Dropdown Menu Label>',
45 /**
46 * True if the menu is disabled.
48 * @attribute disabled
49 * @type boolean
50 * @default false
52 disabled: {value: false, reflect: true},
55 /** @override */
56 domReady: function() {
57 assert(
58 this.querySelector('.menu'),
59 'cr-dropdown-menu must have a menu child with class="menu".');
61 });