Remove useless concept of headless drawer and fix issue with drawer observer

This commit is contained in:
Andrew Kingston 2024-02-27 13:28:13 +00:00
parent e10dd49540
commit c12d3cffc3
2 changed files with 8 additions and 16 deletions

View File

@ -44,7 +44,7 @@
if (get(openDrawers).length) { if (get(openDrawers).length) {
return return
} }
observer.disconnect() observer?.disconnect()
observer = null observer = null
} }
</script> </script>
@ -57,7 +57,6 @@
import { fade } from "svelte/transition" import { fade } from "svelte/transition"
export let title export let title
export let headless = false
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
const spacing = 11 const spacing = 11
@ -156,13 +155,11 @@
{/if} {/if}
<div <div
class="drawer" class="drawer"
class:headless
class:stacked={depth > 0} class:stacked={depth > 0}
class:modal={$modal} class:modal={$modal}
transition:slide|local transition:slide|local
{style} {style}
> >
{#if !headless}
<header> <header>
<div class="text">{title}</div> <div class="text">{title}</div>
<div class="buttons"> <div class="buttons">
@ -170,7 +167,6 @@
<slot name="buttons" /> <slot name="buttons" />
</div> </div>
</header> </header>
{/if}
<slot name="body" /> <slot name="body" />
{#if !$modal && depth > 0} {#if !$modal && depth > 0}
<div class="overlay" transition:fade|local={{ duration: 260 }} /> <div class="overlay" transition:fade|local={{ duration: 260 }} />

View File

@ -175,11 +175,7 @@
bind:this={bindingDrawer} bind:this={bindingDrawer}
{title} {title}
left={drawerLeft} left={drawerLeft}
headless
> >
<svelte:fragment slot="description">
Add the objects on the left to enrich your text.
</svelte:fragment>
<Button cta slot="buttons" disabled={!valid} on:click={saveBinding}> <Button cta slot="buttons" disabled={!valid} on:click={saveBinding}>
Save Save
</Button> </Button>