improvements to nested list

This commit is contained in:
dandds
2019-04-12 13:05:44 -04:00
committed by George Drummond
parent b1dd769e1b
commit 3ab84ba6f4
3 changed files with 48 additions and 64 deletions

View File

@@ -1,24 +1,26 @@
{% from "components/icon.html" import Icon %}
{% macro ToggleList(item_name, item_type, length) %}
<li is="toggler">
<template slot-scope="props">
<span v-on:click="props.toggle">{{ item_name }}</span>
{% macro ToggleItem(action, item_type, length, icon) %}
<span
v-on:click="props.toggle"
class="icon-link icon-link--large accordion-table__item__toggler">
{{ action }} {{ item_type }} ({{ length }}){{ Icon(icon) }}
</span>
{% endmacro %}
<template v-if="props.isVisible">
<span
v-on:click="props.toggle"
class='icon-link icon-link--large accordion-table__item__toggler' >
Hide {{ item_type }} ({{ length }}){{ Icon('caret_up') }}
</span>
</template>
<template v-else>
<span
v-on:click="props.toggle"
class='icon-link icon-link--large accordion-table__item__toggler'>
Show {{ item_type }} ({{ length }}){{ Icon('caret_down') }}
</span>
</template>
{% macro ToggleList(item_name, item_type, length) %}
<li is="toggler" class="accordion-table__item">
<template slot-scope="props">
<div class="accordion-table__item-content">
<span v-on:click="props.toggle">{{ item_name }}</span>
<template v-if="props.isVisible">
{{ ToggleItem("Hide", item_type, length, "caret_up") }}
</template>
<template v-else>
{{ ToggleItem("Show", item_type, length, "caret_down") }}
</template>
</div>
<div v-show="props.isVisible">
{{ caller() }}
</div>