Implement most of the file viewer in svelte
This commit is contained in:
@@ -35,7 +35,7 @@ onMount(() => {
|
||||
datasets: [
|
||||
{
|
||||
label: label,
|
||||
backgroundColor: window.highlight_color,
|
||||
backgroundColor: "#"+window.style.highlightColor,
|
||||
borderWidth: 0,
|
||||
lineTension: 0,
|
||||
fill: true,
|
||||
|
@@ -22,19 +22,18 @@ const load_modal = modal => {
|
||||
}
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
export const show = () => { visible = true; dispatch("shown"); }
|
||||
export const hide = () => { visible = false; dispatch("hidden"); }
|
||||
export const toggle = () => {
|
||||
if (visible) {
|
||||
hide()
|
||||
} else {
|
||||
show()
|
||||
}
|
||||
|
||||
export const show = () => { set_visible(true) }
|
||||
export const hide = () => { set_visible(false) }
|
||||
export const toggle = () => { set_visible(!visible) }
|
||||
export const set_visible = vis => {
|
||||
visible = vis
|
||||
dispatch("is_visible", visible)
|
||||
}
|
||||
|
||||
const keydown = e => {
|
||||
if (e.key === 'Escape') {
|
||||
hide();
|
||||
set_visible(false);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
<style>
|
||||
svg {
|
||||
color: var(--highlight_color);
|
||||
fill: currentColor;
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user