limit the number of displayed thumbs in the records listing

This commit is contained in:
Gani Georgiev 2023-04-15 00:47:49 +03:00
parent 5ddf9cd443
commit 646b6a925b
1 changed files with 6 additions and 1 deletions

View File

@ -102,10 +102,15 @@
{/if} {/if}
</div> </div>
{:else if field.type === "file"} {:else if field.type === "file"}
{@const files = CommonHelper.toArray(rawValue)}
{@const filesLimit = short ? 10 : 200}
<div class="inline-flex"> <div class="inline-flex">
{#each CommonHelper.toArray(rawValue) as filename, i (i + filename)} {#each files.slice(0, filesLimit) as filename, i (i + filename)}
<RecordFileThumb {record} {filename} size="sm" /> <RecordFileThumb {record} {filename} size="sm" />
{/each} {/each}
{#if files.length > filesLimit}
...
{/if}
</div> </div>
{:else if short} {:else if short}
<span class="txt txt-ellipsis" title={CommonHelper.truncate(rawValue)}> <span class="txt txt-ellipsis" title={CommonHelper.truncate(rawValue)}>