From e9a6ccb59c02645f1b07d9d8d10eddddffe1a50f Mon Sep 17 00:00:00 2001 From: exyi Date: Tue, 29 Sep 2020 19:30:04 +0000 Subject: [PATCH] Merge master --- frontend/src/TaskPanel.svelte | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/frontend/src/TaskPanel.svelte b/frontend/src/TaskPanel.svelte index de12775..c4e9782 100644 --- a/frontend/src/TaskPanel.svelte +++ b/frontend/src/TaskPanel.svelte @@ -8,7 +8,7 @@ import TaskDisplay from "./TaskDisplay.svelte"; let selectedTask: TaskDescriptor | null = null export let selectedTaskId: string | null = null - let heightClass: "collapsed" | "full" | "preview" = "collapsed" + let heightClass: "closed" | "collapsed" | "full" | "preview" = "collapsed" export function preSelect(task: TaskDescriptor) { if (heightClass != "full") { @@ -36,13 +36,19 @@ import TaskDisplay from "./TaskDisplay.svelte"; function close() { location.hash = "" - heightClass = "collapsed" + heightClass = "closed" window.setTimeout(() => window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }), 100) } + + function handleKeydown(e: KeyboardEvent) { + if (e.key === "Escape") { + close() + } + } + +
location.hash = `#task/${selectedTask?.id}`}>