Skip to main content
Sign in
Snippets Groups Projects
Commit 767e598a authored by Dorine Lambinet's avatar Dorine Lambinet Committed by David Smadja
Browse files

Ajoute un loader sur le bouton

parent 2ba86cf5
Branches
Tags
1 merge request!329Permettre d'ouvrir / fermer tous les paramètres
......@@ -148,14 +148,16 @@
)
let openOtherParameters = $state(true)
let openAllParameters = $state(true)
</script>
let loadingAllParameters = $state(false)
<button
onclick={() => {
async function toggleOpenAllParameters() {
loadingAllParameters = true
await new Promise((resolve) => setTimeout(resolve, 500))
openAllParameters = !openAllParameters
}}
>{#if openAllParameters === false}Ouvrir tout{:else}Fermer tout{/if}</button
>
loadingAllParameters = false
}
</script>
{#if billDecomposition !== undefined || billVariable !== undefined}
<div class="px-3">
<VariableHeader
......@@ -221,11 +223,33 @@
{/each}
</div>
{/if}
<div
class="border-t px-2 pt-4 sm:px-3"
class:mt-5={billDecomposition?.children !== undefined}
></div>
<div class="pl-4 pr-2 sm:px-4">
<!-- Bouton toggle "Ouvrir tout / Fermer tout" -->
<button
aria-label={openAllParameters ? "Fermer tout" : "Ouvrir tout"}
class="mb-2 ml-2 flex items-center text-xs uppercase tracking-wide text-neutral-500 hover:text-le-gris-dispositif-dark"
onclick={toggleOpenAllParameters}
>
{#if loadingAllParameters}
<iconify-icon
icon="ri-loader-4-line"
class="mr-1 animate-spin text-base text-neutral-400"
></iconify-icon>
{:else}
<iconify-icon
icon={openAllParameters
? "ri-folder-reduce-line"
: "ri-folder-open-line"}
class="mr-1 text-base"
></iconify-icon>
{/if}
</button>
{#if Object.keys(bothRootDirectParameterById).length > 0}
<section class="mb-2 border-b pb-4">
<ul>
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment