web/dialogs: move backdrop close handler to container

This commit is contained in:
wukko 2024-07-27 15:30:00 +06:00
parent b8eb708748
commit 59f5560802
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2
4 changed files with 3 additions and 9 deletions

View file

@ -2,6 +2,8 @@
import { tick } from "svelte"; import { tick } from "svelte";
import { killDialog } from "$lib/dialogs"; import { killDialog } from "$lib/dialogs";
import DialogBackdropClose from "$components/dialog/DialogBackdropClose.svelte";
export let id: string; export let id: string;
let dialogParent: HTMLDialogElement; let dialogParent: HTMLDialogElement;
@ -30,4 +32,5 @@
<dialog id="dialog-{id}" bind:this={dialogParent} class:closing class:open> <dialog id="dialog-{id}" bind:this={dialogParent} class:closing class:open>
<slot></slot> <slot></slot>
<DialogBackdropClose closeFunc={close} />
</dialog> </dialog>

View file

@ -10,7 +10,6 @@
import PickerItem from "$components/dialog/PickerItem.svelte"; import PickerItem from "$components/dialog/PickerItem.svelte";
import DialogButtons from "$components/dialog/DialogButtons.svelte"; import DialogButtons from "$components/dialog/DialogButtons.svelte";
import DialogBackdropClose from "$components/dialog/DialogBackdropClose.svelte";
import IconBoxMultiple from "@tabler/icons-svelte/IconBoxMultiple.svelte"; import IconBoxMultiple from "@tabler/icons-svelte/IconBoxMultiple.svelte";
@ -58,8 +57,6 @@
<DialogButtons {buttons} closeFunc={close} /> <DialogButtons {buttons} closeFunc={close} />
{/if} {/if}
</div> </div>
<DialogBackdropClose closeFunc={close} />
</DialogContainer> </DialogContainer>
<style> <style>

View file

@ -7,7 +7,6 @@
import Meowbalt from "$components/misc/Meowbalt.svelte"; import Meowbalt from "$components/misc/Meowbalt.svelte";
import DialogButtons from "$components/dialog/DialogButtons.svelte"; import DialogButtons from "$components/dialog/DialogButtons.svelte";
import DialogBackdropClose from "$components/dialog/DialogBackdropClose.svelte";
import VerticalActionButton from "$components/buttons/VerticalActionButton.svelte"; import VerticalActionButton from "$components/buttons/VerticalActionButton.svelte";
import IconCopy from "@tabler/icons-svelte/IconCopy.svelte"; import IconCopy from "@tabler/icons-svelte/IconCopy.svelte";
@ -74,8 +73,6 @@
closeFunc={close} closeFunc={close}
/> />
</div> </div>
<DialogBackdropClose closeFunc={close} />
</DialogContainer> </DialogContainer>
<style> <style>

View file

@ -7,7 +7,6 @@
import Meowbalt from "$components/misc/Meowbalt.svelte"; import Meowbalt from "$components/misc/Meowbalt.svelte";
import DialogButtons from "$components/dialog/DialogButtons.svelte"; import DialogButtons from "$components/dialog/DialogButtons.svelte";
import DialogBackdropClose from "$components/dialog/DialogBackdropClose.svelte";
import IconAlertTriangle from "@tabler/icons-svelte/IconAlertTriangle.svelte"; import IconAlertTriangle from "@tabler/icons-svelte/IconAlertTriangle.svelte";
@ -53,8 +52,6 @@
<DialogButtons {buttons} closeFunc={close} /> <DialogButtons {buttons} closeFunc={close} />
{/if} {/if}
</div> </div>
<DialogBackdropClose closeFunc={close} />
</DialogContainer> </DialogContainer>
<style> <style>