Vulcan/client/views/nav/dropdown_component.html
2015-03-23 10:49:21 +09:00

60 lines
No EOL
1.9 KiB
HTML

<!--
Dropdown Component
dropdownName (String)
| The name of the dropdown
dropdownItems (Array)
| An array containing the contents of the dropdown
- route (String/Function) [optional]
- label (String/Function) [optional]
- description (String) [optional]
- adminOnly (Boolean) [optional]
| whether to only show the item to admins
- template (String) [optional]
| if a template is provided, it will override the route/label/description
- data (Object) [optional]
| data contexnt for the template
dropdownLabel (String) [optional]
dropdownExpanded (Boolean) [optional]
| If true, the dropdown is always expanded
dropdownClass (String) [optional]
| An optional default CSS class given to the dropdown
-->
<template name="dropdownComponent">
<div class="dropdown {{dropdownClass}}">
<div class="dropdown-top-level" href="/">{{dropdownLabel}}</div>
<div class="dropdown-menu">
{{#with dropdownItems}}
<ul class="dropdown-contents" role="menu" aria-labelledby="dLabel">
{{#each this}}
{{#if showDropdownItem}}
{{#if hasTemplate}}
{{> Template.dynamic template=template data=data}}
{{else}}
<li class="{{itemClass}}">
<a class="dropdown-sub-level" href="{{itemRoute}}">
<span class="menu-label">{{itemLabel}}</span>
{{#if description}}<span class="menu-description">{{_ description}}</span>{{/if}}
</a>
</li>
{{/if}}
{{/if}}
{{/each}}
</ul>
{{#if showMore}}
<a class="show-more" href="#">
<img class="show-more-icon show-more-plus svg svg-buttoncolor" data-src="/img/plus.svg" aria-hidden="true"/>
<img class="show-more-icon show-more-minus svg svg-buttoncolor" data-src="/img/minus.svg" aria-hidden="true"/>
</a>
{{/if}}
{{/with}}
</div>
</div>
</template>