[Cronet] Delay StartNetLog and StopNetLog until native request context is initialized
[chromium-blink-merge.git] / third_party / polymer / components-chromium / core-dropdown / core-dropdown.html
blob898c7b74be030628c2ecc2658cdd6a7949443956
1 <!--
2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 Code distributed by Google as part of the polymer project is also
7 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 --><!--
10 `core-dropdown` is an element that is initially hidden and is positioned relatively to another
11 element, usually the element that triggers the dropdown. The dropdown and the triggering element
12 should be children of the same offsetParent, e.g. the same `<div>` with `position: relative`.
13 It can be used to implement dropdown menus, menu buttons, etc..
15 Example:
17 <template is="auto-binding">
18 <div relative>
19 <core-icon-button id="trigger" icon="menu"></core-icon-button>
20 <core-dropdown relatedTarget="{{$.trigger}}">
21 <core-menu>
22 <core-item>Cut</core-item>
23 <core-item>Copy</core-item>
24 <core-item>Paste</core-item>
25 </core-menu>
26 </core-dropdown>
27 </div>
28 </template>
30 Positioning
31 -----------
33 By default, the dropdown is absolutely positioned on top of the `relatedTarget` with the top and
34 left edges aligned. The `halign` and `valign` properties controls the various alignments. The size
35 of the dropdown is automatically restrained such that it is entirely visible on the screen. Use the
36 `margin`
38 If you need more control over the dropdown's position, use CSS. The `halign` and `valign` properties are
39 ignored if the dropdown is positioned with CSS.
41 Example:
43 <style>
44 /* manually position the dropdown below the trigger */
45 core-dropdown {
46 position: absolute;
47 top: 38px;
48 left: 0;
50 </style>
52 <template is="auto-binding">
53 <div relative>
54 <core-icon-button id="trigger" icon="menu"></core-icon-button>
55 <core-dropdown relatedTarget="{{$.trigger}}">
56 <core-menu>
57 <core-item>Cut</core-item>
58 <core-item>Copy</core-item>
59 <core-item>Paste</core-item>
60 </core-menu>
61 </core-dropdown>
62 </div>
63 </template>
65 The `layered` property
66 ----------------------
68 Sometimes you may need to render the dropdown in a separate layer. For example,
69 it may be nested inside an element that needs to be `overflow: hidden`, or
70 its parent may be overlapped by elements above it in stacking order.
72 The `layered` property will place the dropdown in a separate layer to ensure
73 it appears on top of everything else. Note that this implies the dropdown will
74 not scroll with its container.
76 @group Polymer Core Elements
77 @element core-dropdown
78 @extends core-overlay
79 @homepage github.io
80 --><html><head><link href="../polymer/polymer.html" rel="import">
81 <link href="../core-overlay/core-overlay.html" rel="import">
83 <style shim-shadowdom="">
84 html /deep/ core-dropdown {
85 position: absolute;
86 overflow: auto;
87 background-color: #fff;
89 </style>
91 </head><body><polymer-element name="core-dropdown" extends="core-overlay" assetpath="">
93 </polymer-element>
94 <script charset="utf-8" src="core-dropdown-extracted.js"></script></body></html>