2021-04-27 21:01:44 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
|
|
|
<script lang="typescript">
|
2021-05-05 01:22:51 +02:00
|
|
|
import Detachable from "components/Detachable.svelte";
|
|
|
|
|
2021-04-27 21:01:44 +02:00
|
|
|
import { getContext } from "svelte";
|
|
|
|
import { buttonGroupKey } from "./contextKeys";
|
|
|
|
|
2021-05-05 15:12:02 +02:00
|
|
|
export let registration = undefined;
|
|
|
|
|
2021-04-27 21:01:44 +02:00
|
|
|
const { registerButton } = getContext(buttonGroupKey);
|
2021-05-05 15:12:02 +02:00
|
|
|
const { detach } = registration ?? registerButton();
|
2021-04-27 21:01:44 +02:00
|
|
|
</script>
|
|
|
|
|
2021-05-05 01:22:51 +02:00
|
|
|
<Detachable detach={$detach}>
|
|
|
|
<slot />
|
|
|
|
</Detachable>
|