Vulcan/client/views/nav/dropdown_component.html
2015-03-24 13:13:04 +09:00

58 lines
No EOL
1.7 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]
dropdownClass (String) [optional]
| An optional default CSS class given to the dropdown
dropdownMode (String) [optional]
| "accordion", "hover", or "list" (defaults to "list")
-->
<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>
{{/with}}
<a class="show-more" href="#">
{{{icon "open"}}}
{{{icon "close"}}}
</a>
</div>
</div>
</template>