Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Unified Diff: ui/webui/resources/cr_elements/cr_dropdown_menu/cr_dropdown_menu.js

Issue 917893004: Add a <cr-dropdown-menu> custom element to cr_elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@paperdropdown
Patch Set: Add a valid license header to the css Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/webui/resources/cr_elements/cr_dropdown_menu/cr_dropdown_menu.js
diff --git a/ui/webui/resources/cr_elements/cr_dropdown_menu/cr_dropdown_menu.js b/ui/webui/resources/cr_elements/cr_dropdown_menu/cr_dropdown_menu.js
new file mode 100644
index 0000000000000000000000000000000000000000..70f3253ec1a73c185aef991439f597e08deec91f
--- /dev/null
+++ b/ui/webui/resources/cr_elements/cr_dropdown_menu/cr_dropdown_menu.js
@@ -0,0 +1,52 @@
+/* Copyright 2015 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file. */
+
+/**
+ * @fileoverview
+ * 'cr-dropdown-menu' is a Chrome-specific wrapper around paper-dropdown-menu.
+ * It includes a paper-dropdown so its content should just be a core-menu and
+ * items.
+ *
+ * Example:
+ * <cr-dropdown-menu>
+ * <core-menu>
+ * <paper-item>Chrome</paper-item>
+ * <paper-item>Firefox</paper-item>
+ * <paper-item>IE</paper-item>
+ * <paper-item>Opera</paper-item>
+ * </core-menu>
+ * </cr-dropdown-menu>
+ *
+ * @group Chrome Elements
+ * @element cr-dropdown-menu
+ */
+
+Polymer('cr-dropdown-menu', {
+ publish: {
+ /**
+ * True if the menu is open.
+ *
+ * @attribute opened
+ * @type boolean
+ * @default false
+ */
+ opened: false,
+
+ /**
+ * A label for the control. The label is displayed if no item is selected.
+ *
+ * @attribute label
+ * @type string
+ * @default '<Dropdown Menu Label>'
+ */
+ label: '<Dropdown Menu Label>',
+ },
+
+ /** @override */
+ domReady: function() {
+ assert(
+ this.querySelector('.menu'),
+ 'cr-dropdown-menu must have a menu child with class="menu".');
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698