mirror of
https://github.com/ankitects/anki.git
synced 2026-01-08 03:23:54 -05:00
38 lines
845 B
Svelte
38 lines
845 B
Svelte
<!--
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
-->
|
|
<script lang="ts">
|
|
import Popover from "$lib/components/Popover.svelte";
|
|
import WithFloating from "$lib/components/WithFloating.svelte";
|
|
|
|
export let showFloating = false;
|
|
export let lockOpen = false;
|
|
</script>
|
|
|
|
<div>
|
|
<WithFloating
|
|
show={showFloating}
|
|
inline
|
|
on:close={() => {
|
|
if (!lockOpen) {
|
|
showFloating = false;
|
|
}
|
|
}}
|
|
closeOnInsideClick
|
|
>
|
|
<slot slot="reference" name="button"></slot>
|
|
|
|
<Popover slot="floating">
|
|
<slot name="items" />
|
|
</Popover>
|
|
</WithFloating>
|
|
</div>
|
|
|
|
<style>
|
|
div :global(.popover) {
|
|
padding: 0;
|
|
|
|
max-height: 100vh;
|
|
}
|
|
</style>
|