3 Copyright (c) 2015 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 --><html><head><link rel=
"import" href=
"../polymer/polymer.html">
10 <link rel=
"import" href=
"../iron-dropdown/iron-dropdown.html">
11 <link rel=
"import" href=
"../iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
12 <link rel=
"import" href=
"../iron-behaviors/iron-control-state.html">
13 <link rel=
"import" href=
"../paper-material/paper-material.html">
14 <link rel=
"import" href=
"../paper-styles/default-theme.html">
15 <link rel=
"import" href=
"../neon-animation/animations/fade-in-animation.html">
16 <link rel=
"import" href=
"../neon-animation/animations/fade-out-animation.html">
17 <link rel=
"import" href=
"paper-menu-button-animations.html">
20 `paper-menu-button` allows one to compose a designated "trigger" element with
21 another element that represents "content", to create a dropdown menu that
22 displays the "content" when the "trigger" is clicked.
24 The child element with the class `dropdown-trigger` will be used as the
25 "trigger" element. The child element with the class `dropdown-content` will be
26 used as the "content" element.
28 The `paper-menu-button` is sensitive to its content's `iron-select` events. If
29 the "content" element triggers an `iron-select` event, the `paper-menu-button`
30 will close automatically.
35 <paper-icon-button icon="menu" class="dropdown-trigger"></paper-icon-button>
36 <paper-menu class="dropdown-content">
37 <paper-item>Share</paper-item>
38 <paper-item>Settings</paper-item>
39 <paper-item>Help</paper-item>
45 The following custom properties and mixins are also available for styling:
47 Custom property | Description | Default
48 ----------------|-------------|----------
49 `--paper-menu-button-dropdown-background` | Background color of the paper-menu-button dropdown | `#fff`
50 `--paper-menu-button` | Mixin applied to the paper-menu-button | `{}`
51 `--paper-menu-button-disabled` | Mixin applied to the paper-menu-button when disabled | `{}`
52 `--paper-menu-button-dropdown` | Mixin applied to the paper-menu-button dropdown | `{}`
59 </head><body><dom-module id=
"paper-menu-button">
62 display: inline-block;
67 @apply(--paper-menu-button);
72 color: var(--disabled-text-color);
74 @apply(--paper-menu-button-disabled);
77 :host([
vertical-align=
"top"]) paper-material {
83 :host([
vertical-align=
"bottom"]) paper-material {
91 background-color: var(--paper-menu-button-dropdown-background, --primary-background-color);
93 @apply(--paper-menu-button-dropdown);
97 <div id=
"trigger" on-tap=
"open">
98 <content select=
".dropdown-trigger"></content>
100 <iron-dropdown id=
"dropdown" opened=
"{{opened}}" horizontal-align=
"[[horizontalAlign]]" vertical-align=
"[[verticalAlign]]" horizontal-offset=
"[[horizontalOffset]]" vertical-offset=
"[[verticalOffset]]" open-animation-config=
"[[openAnimationConfig]]" close-animation-config=
"[[closeAnimationConfig]]" no-animations=
"[[noAnimations]]">
101 <paper-material class=
"dropdown-content">
102 <content select=
".dropdown-content"></content>
107 <script src=
"paper-menu-button-extracted.js"></script></body></html>