OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <!-- |
| 3 @license |
| 4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 5 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 7 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 8 Code distributed by Google as part of the polymer project is also |
| 9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 10 --> |
| 11 <html> |
| 12 <head> |
| 13 |
| 14 <title>iron-dropdown</title> |
| 15 |
| 16 <script src="../../webcomponentsjs/webcomponents-lite.js"></script> |
| 17 <link rel="import" href="../../iron-image/iron-image.html"> |
| 18 <link rel="import" href="../../paper-styles/demo-pages.html"> |
| 19 <link rel="import" href="x-select.html"> |
| 20 <style> |
| 21 |
| 22 ul { |
| 23 display: block; |
| 24 position: relative; |
| 25 background-color: #fff; |
| 26 box-shadow: 0px 2px 6px #ccc; |
| 27 margin: 0.25em 0; |
| 28 padding: 0.25em; |
| 29 border-radius: 3px; |
| 30 } |
| 31 |
| 32 [vertical-align="top"] ul { |
| 33 margin-top: 0; |
| 34 } |
| 35 |
| 36 [vertical-align="bottom"] ul { |
| 37 margin-bottom: 0; |
| 38 } |
| 39 |
| 40 li { |
| 41 display: block; |
| 42 position: relative; |
| 43 margin: 0; |
| 44 padding: 0; |
| 45 } |
| 46 |
| 47 a { |
| 48 display: block; |
| 49 position: relative; |
| 50 padding: 1em; |
| 51 text-decoration: none; |
| 52 } |
| 53 |
| 54 li:not(:last-of-type) { |
| 55 border-bottom: 1px solid #eee; |
| 56 } |
| 57 |
| 58 a:hover { |
| 59 text-decoration: underline; |
| 60 } |
| 61 |
| 62 button { |
| 63 border: 1px solid #ccc; |
| 64 background-color: #eee; |
| 65 padding: 1em; |
| 66 border-radius: 3px; |
| 67 cursor: pointer; |
| 68 } |
| 69 |
| 70 button:focus { |
| 71 outline: none; |
| 72 border-color: blue; |
| 73 } |
| 74 |
| 75 iron-image { |
| 76 padding: 1em; |
| 77 background-color: #fff; |
| 78 box-shadow: 0px 2px 6px #ccc; |
| 79 border-radius: 3px; |
| 80 } |
| 81 </style> |
| 82 </head> |
| 83 <body> |
| 84 <template is="dom-bind" id="Demo"> |
| 85 <div class="horizontal-section flex layout horizontal"> |
| 86 <x-select> |
| 87 <button class="dropdown-trigger">Basic</button> |
| 88 <ul class="dropdown-content"> |
| 89 <template is="dom-repeat" items="[[letters]]"> |
| 90 <li><a href="javascript:void(0)">[[item]]</a></li> |
| 91 </template> |
| 92 </ul> |
| 93 </x-select> |
| 94 <x-select> |
| 95 <button class="dropdown-trigger">Overflowing</button> |
| 96 <ul class="dropdown-content" tabindex="0"> |
| 97 <template is="dom-repeat" items="[[dinosaurs]]"> |
| 98 <li><a href="javascript:void(0)">[[item]]</a></li> |
| 99 </template> |
| 100 </ul> |
| 101 </x-select> |
| 102 <x-select vertical-align="bottom"> |
| 103 <button class="dropdown-trigger">Bottom-left Aligned</button> |
| 104 <ul class="dropdown-content"> |
| 105 <template is="dom-repeat" items="[[letters]]"> |
| 106 <li><a href="javascript:void(0)">[[item]]</a></li> |
| 107 </template> |
| 108 </ul> |
| 109 </x-select> |
| 110 <x-select horizontal-align="right" vertical-align="top"> |
| 111 <button class="dropdown-trigger">Top-right Aligned</button> |
| 112 <ul class="dropdown-content"> |
| 113 <template is="dom-repeat" items="[[dinosaurs]]"> |
| 114 <li><a href="javascript:void(0)">[[item]]</a></li> |
| 115 </template> |
| 116 </ul> |
| 117 </x-select> |
| 118 <x-select horizontal-align="left" vertical-align="top"> |
| 119 <button class="dropdown-trigger">Alternate Content</button> |
| 120 <iron-image class="dropdown-content" src="../../iron-image/demo/polymer.
svg"></iron-image> |
| 121 </x-select> |
| 122 </div> |
| 123 </template> |
| 124 |
| 125 <script> |
| 126 Demo.letters = [ |
| 127 'alpha', |
| 128 'beta', |
| 129 'gamma', |
| 130 'delta', |
| 131 'epsilon' |
| 132 ]; |
| 133 Demo.dinosaurs = [ |
| 134 'allosaurus', |
| 135 'brontosaurus', |
| 136 'carcharodontosaurus', |
| 137 'diplodocus', |
| 138 'ekrixinatosaurus', |
| 139 'fukuiraptor', |
| 140 'gallimimus', |
| 141 'hadrosaurus', |
| 142 'iguanodon', |
| 143 'jainosaurus', |
| 144 'kritosaurus', |
| 145 'liaoceratops', |
| 146 'megalosaurus', |
| 147 'nemegtosaurus', |
| 148 'ornithomimus', |
| 149 'protoceratops', |
| 150 'quetecsaurus', |
| 151 'rajasaurus', |
| 152 'stegosaurus', |
| 153 'triceratops', |
| 154 'utahraptor', |
| 155 'vulcanodon', |
| 156 'wannanosaurus', |
| 157 'xenoceratops', |
| 158 'yandusaurus', |
| 159 'zephyrosaurus' |
| 160 ]; |
| 161 </script> |
| 162 </body> |
| 163 </html> |
OLD | NEW |