Hide collapse button if no channels

This commit is contained in:
Alistair McKinlay 2018-03-02 13:59:45 +00:00 committed by Jérémie Astori
parent 49f2721908
commit 894d6f162d
No known key found for this signature in database
GPG Key ID: B9A4F245CD67BDE8
2 changed files with 9 additions and 3 deletions

View File

@ -717,6 +717,11 @@ kbd {
transition: opacity 0.2s, background-color 0.2s, transform 0.2s;
}
button.collapse-network:first-child:nth-last-child(3) {
/* Hide collapse button if there are no channels/queries */
display: none;
}
#sidebar .network.collapsed .collapse-network {
transform: rotate(-90deg);
}

View File

@ -6,10 +6,11 @@
data-nick="{{nick}}"
data-options="{{tojson serverOptions}}"
>
<button class="collapse-network" aria-label="Collapse" data-id="{{id}}"
aria-controls="network-{{id}}-chanlist" aria-expanded="true"></button>
<div id="network-{{id}}-chanlist" role="region" class="chanlist">
{{> chan}}
<button class="collapse-network" aria-label="Collapse" data-id="{{id}}"
aria-controls="network-{{id}}-chanlist" aria-expanded="true">
</button>
{{> chan}}
</div>
</section>
{{/each}}