Remove useless concept of headless drawer and fix issue with drawer observer
This commit is contained in:
parent
e10dd49540
commit
c12d3cffc3
|
@ -44,7 +44,7 @@
|
|||
if (get(openDrawers).length) {
|
||||
return
|
||||
}
|
||||
observer.disconnect()
|
||||
observer?.disconnect()
|
||||
observer = null
|
||||
}
|
||||
</script>
|
||||
|
@ -57,7 +57,6 @@
|
|||
import { fade } from "svelte/transition"
|
||||
|
||||
export let title
|
||||
export let headless = false
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
const spacing = 11
|
||||
|
@ -156,21 +155,18 @@
|
|||
{/if}
|
||||
<div
|
||||
class="drawer"
|
||||
class:headless
|
||||
class:stacked={depth > 0}
|
||||
class:modal={$modal}
|
||||
transition:slide|local
|
||||
{style}
|
||||
>
|
||||
{#if !headless}
|
||||
<header>
|
||||
<div class="text">{title}</div>
|
||||
<div class="buttons">
|
||||
<Button secondary quiet on:click={hide}>Cancel</Button>
|
||||
<slot name="buttons" />
|
||||
</div>
|
||||
</header>
|
||||
{/if}
|
||||
<header>
|
||||
<div class="text">{title}</div>
|
||||
<div class="buttons">
|
||||
<Button secondary quiet on:click={hide}>Cancel</Button>
|
||||
<slot name="buttons" />
|
||||
</div>
|
||||
</header>
|
||||
<slot name="body" />
|
||||
{#if !$modal && depth > 0}
|
||||
<div class="overlay" transition:fade|local={{ duration: 260 }} />
|
||||
|
|
|
@ -175,11 +175,7 @@
|
|||
bind:this={bindingDrawer}
|
||||
{title}
|
||||
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}>
|
||||
Save
|
||||
</Button>
|
||||
|
|
Loading…
Reference in New Issue