-
Notifications
You must be signed in to change notification settings - Fork 0
/
collapsible-selector.html
executable file
·65 lines (52 loc) · 1.57 KB
/
collapsible-selector.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!-- external scripts -->
<script src"../lodash/lodash.min.js"></script>
<!-- external imports -->
<link rel="import" href="../polymer/polymer.html">
<!-- local imports -->
<link rel="import" href="styles/collapsible-selector-style.html">
<!--
`collapsible-selector`
Polymer JS 1.x custom selector element that collapses based on available width.
Works in a similar fashion to the tab bar in chrome/firefox dev tools.
@demo demo/index.html
-->
<dom-module id="collapsible-selector">
<template>
<style include="collapsible-selector-style"></style>
<nav class="nav-bar invisible">
<template is="dom-repeat" items="[[items]]">
<button
class="nav-item"
data-item-name="[[item.value]]"
on-tap="_setSelectedItemFromNav"
>
[[item.display]]
</button>
</template>
<div class="dropdown-container">
<button
class="dropdown-title"
on-focusout="_closeDropdown"
on-tap="_openDropdown"
>
[[dropdownButtonText]]
</button>
<div class="dropdown-items">
<template is="dom-repeat" items="[[_dropdownItems]]">
<button
class="dropdown-item"
data-item-name="[[item.value]]"
on-mousedown="_setSelectedItem"
>
[[item.display]]
</button>
</template>
</div>
</div>
</nav>
<div class="nav-bar-line">
<div class="nav-indicator"></div>
</div>
</template>
<script src="collapsible-selector.js"></script>
</dom-module>