mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-21 21:36:26 -08:00
working on things
This commit is contained in:
parent
8769761163
commit
94c73b6dc0
|
@ -1,6 +1,8 @@
|
||||||
<script context="module">
|
<script context="module">
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
export const pulldownOpen = writable(0);
|
import { allPulldowns } from "./pulldowns/Pulldown.svelte";
|
||||||
|
|
||||||
|
export const pulldownOpen = writable(false);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -11,8 +13,8 @@
|
||||||
return $pulldownOpen
|
return $pulldownOpen
|
||||||
}
|
}
|
||||||
|
|
||||||
export function openPulldown() {
|
export function openPulldown(name) {
|
||||||
pulldownOpen.set(true)
|
pulldownOpen.set(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function closePulldown() {
|
export function closePulldown() {
|
||||||
|
@ -25,7 +27,9 @@
|
||||||
</script>
|
</script>
|
||||||
{#if $pulldownOpen}
|
{#if $pulldownOpen}
|
||||||
<div class="pulldown" transition:fade={{duration:200}}>
|
<div class="pulldown" transition:fade={{duration:200}}>
|
||||||
|
<!-- I'm not sure how I could do this any better, so... yeah -->
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
|
7
src/svelte/elem/pulldowns/Accounts.svelte
Normal file
7
src/svelte/elem/pulldowns/Accounts.svelte
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<script>
|
||||||
|
import { Pulldown } from "./Pulldown.svelte"
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Pulldown name="accounts">
|
||||||
|
|
||||||
|
</Pulldown>
|
20
src/svelte/elem/pulldowns/Pulldown.svelte
Normal file
20
src/svelte/elem/pulldowns/Pulldown.svelte
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<script context="module">
|
||||||
|
import { writable } from "svelte/store";
|
||||||
|
|
||||||
|
export const allPulldowns = writable(new Map());
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
import { pulldownOpen } from "../PulldownManager.svelte";
|
||||||
|
|
||||||
|
export let name;
|
||||||
|
|
||||||
|
allPulldowns
|
||||||
|
.set(name,this)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="pulldown_display"
|
||||||
|
style:display={$pulldownOpen == name ? "block" : "none"}
|
||||||
|
>
|
||||||
|
<slot />
|
||||||
|
</div>
|
Loading…
Reference in a new issue