feat(webui): all column sections can now be hidden
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Tomáš Mládek 2024-07-27 19:28:38 +02:00
parent b3796d362c
commit d29df7ef9a
7 changed files with 10 additions and 8 deletions

View file

@ -14,7 +14,7 @@
}>();
export let entities: string[];
export let hide = false;
export let hidden = false;
export let header = '';
export let icon: string | null = null;
@ -40,7 +40,7 @@
}
</script>
<LabelBorder {hide}>
<LabelBorder {hidden}>
<span slot="header"
>{#if icon}<Icon plain name={icon} />
{/if}{header}</span

View file

@ -84,7 +84,7 @@
}
</script>
<LabelBorder hide={entries.length === 0 && entities.length === 0}>
<LabelBorder hidden={entries.length === 0 && entities.length === 0}>
<svelte:fragment slot="header-full">
<h3 class:highlighted>
{#if group}

View file

@ -40,7 +40,7 @@
entities={Object.keys(groups)}
header={$i18n.t('Groups') || ''}
icon="link-alt"
hide={Object.keys(groups).length === 0}
hidden={Object.keys(groups).length === 0}
on:add={(e) => addGroup(e.detail)}
on:remove={(e) => removeGroup(e.detail)}
on:highlighted

View file

@ -35,6 +35,8 @@
const addresses = context ? context.addresses : readable([]);
function onClick(ev: MouseEvent) {
ev.preventDefault();
ev.stopPropagation();
if (window.location.pathname.startsWith('/browse')) {
let newAddresses = $addresses.concat();

View file

@ -13,7 +13,7 @@
</script>
<button
on:click
on:click|preventDefault|stopPropagation
class:active
class:outline
class:subdued

View file

@ -1,8 +1,8 @@
<script lang="ts">
import { slide } from 'svelte/transition';
export let hide = false;
let hidden = true;
export let hide = true;
export let hidden = true;
</script>
<section class="labelborder" class:hide class:hidden>

View file

@ -34,7 +34,7 @@
}
</script>
<LabelBorder hide={!notes?.length}>
<LabelBorder hidden={!notes?.length}>
<span slot="header"><Icon plain name="note" /> {$i18n.t('Notes')}</span>
<div class="notes" contenteditable on:input={onInput} bind:this={contentEl}>
{#each (notes || '\n').split('\n') as line, idx}