Hide Viewlet selector for just one element (#581)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2021-12-08 16:06:19 +07:00 committed by GitHub
parent 21b2d3e2bd
commit 18613428e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,18 +63,19 @@ function onSearch(ev: Event) {
<div class="flex-between toolbar">
<EditWithIcon icon={IconSearch} placeholder={'Search'} on:change={onSearch}/>
<div class="flex">
{#each viewlets as viewlet, i}
<div class="flex-center btn" class:selected={selected === i} on:click={()=>{ selected = i }}>
<div class="icon">
<Tooltip label={viewlet.$lookup?.descriptor?.label} direction={'top'}>
<Icon icon={viewlet.$lookup?.descriptor?.icon} size={'small'}/>
</Tooltip>
{#if viewlets.length > 1}
<div class="flex">
{#each viewlets as viewlet, i}
<div class="flex-center btn" class:selected={selected === i} on:click={()=>{ selected = i }}>
<div class="icon">
<Tooltip label={viewlet.$lookup?.descriptor?.label} direction={'top'}>
<Icon icon={viewlet.$lookup?.descriptor?.icon} size={'small'}/>
</Tooltip>
</div>
</div>
</div>
{/each}
</div>
{/each}
</div>
{/if}
</div>
{/if}