You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
390 B
JavaScript
15 lines
390 B
JavaScript
import { writable } from 'svelte/store';
|
|
|
|
export const popovers = writable([]);
|
|
|
|
let popoverId = 0;
|
|
|
|
export function showPopover(content, triggerRect, options = {}) {
|
|
const id = popoverId++;
|
|
popovers.update(items => [...items, { id, content, triggerRect, options }]);
|
|
return id;
|
|
}
|
|
|
|
export function hidePopover(id) {
|
|
popovers.update(items => items.filter(item => item.id !== id));
|
|
}
|