• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!doctype html>
2<!--
3@license
4Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
5This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8Code distributed by Google as part of the polymer project is also
9subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.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    .dropdown-content {
23      background-color: white;
24      line-height: 20px;
25      border-radius: 3px;
26      box-shadow: 0px 2px 6px #ccc;
27    }
28
29    .random-content {
30      padding: 1.5em 2em;
31      max-width: 250px;
32    }
33
34    button {
35      border: 1px solid #ccc;
36      background-color: #eee;
37      padding: 1em;
38      border-radius: 3px;
39      cursor: pointer;
40    }
41
42    button:focus {
43      outline: none;
44      border-color: blue;
45    }
46
47    ul {
48      margin: 0;
49      padding: 0;
50    }
51
52    li {
53      display: block;
54      position: relative;
55      margin: 0;
56      padding: 0;
57    }
58
59    a {
60      display: block;
61      position: relative;
62      padding: 1em;
63      text-decoration: none;
64    }
65
66    li:not(:last-of-type) {
67      border-bottom: 1px solid #eee;
68    }
69
70    a:hover {
71      text-decoration: underline;
72    }
73
74    iron-image {
75      padding: 1em;
76      background-color: #fff;
77      box-shadow: 0px 2px 6px #ccc;
78      border-radius: 3px;
79    }
80  </style>
81</head>
82<body>
83  <template is="dom-bind" id="Demo">
84   <div class="vertical-section vertical-section-container ">
85      <h1>iron-dropdown</h1>
86      <p>Examples of vanilla elements.</p>
87      <div>
88        <x-select>
89          <button class="dropdown-trigger">Basic</button>
90          <div class="dropdown-content random-content">
91           Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
92          </div>
93        </x-select>
94        <x-select>
95          <button class="dropdown-trigger">Overflowing</button>
96          <div class="dropdown-content random-content">
97            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
98            <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
99          </div>
100        </x-select>
101        <x-select vertical-align="bottom">
102          <button class="dropdown-trigger">Bottom-left Aligned</button>
103          <div class="dropdown-content random-content">
104            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
105          </div>
106        </x-select>
107        <x-select horizontal-align="right" vertical-align="top">
108          <button class="dropdown-trigger">Top-right Aligned</button>
109          <div class="dropdown-content random-content">
110            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
111          </div>
112        </x-select>
113        <x-select horizontal-align="left" vertical-align="top">
114          <button class="dropdown-trigger"> Content</button>
115          <iron-image class="dropdown-content" src="../../iron-image/demo/polymer.svg"></iron-image>
116        </x-select>
117        <x-select horizontal-align="right" vertical-align="top">
118          <button class="dropdown-trigger">Unordered list</button>
119          <ul class="dropdown-content" tabindex="0">
120            <template is="dom-repeat" items="[[dinosaurs]]">
121              <li><a href="javascript:void(0)">[[item]]</a></li>
122            </template>
123          </ul>
124        </x-select>
125      </div>
126    </div>
127  </template>
128
129  <script>
130    Demo.dinosaurs = [
131      'allosaurus',
132      'brontosaurus',
133      'carcharodontosaurus',
134      'diplodocus',
135      'ekrixinatosaurus',
136      'fukuiraptor',
137      'gallimimus',
138      'hadrosaurus',
139      'iguanodon',
140      'jainosaurus',
141      'kritosaurus',
142      'liaoceratops',
143      'megalosaurus',
144      'nemegtosaurus',
145      'ornithomimus',
146      'protoceratops',
147      'quetecsaurus',
148      'rajasaurus',
149      'stegosaurus',
150      'triceratops',
151      'utahraptor',
152      'vulcanodon',
153      'wannanosaurus',
154      'xenoceratops',
155      'yandusaurus',
156      'zephyrosaurus'
157    ];
158  </script>
159</body>
160</html>
161