Fix full close of TaskPanel
This commit is contained in:
parent
f06c103103
commit
8c99862103
1 changed files with 8 additions and 4 deletions
|
@ -19,29 +19,33 @@
|
||||||
|
|
||||||
export function unPreselect(task: TaskDescriptor) {
|
export function unPreselect(task: TaskDescriptor) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (selectedTask && task.id == selectedTask.id && heightClass != "full") {
|
if (selectedTask && task.id == selectedTask.id && heightClass == "preview") {
|
||||||
heightClass = "collapsed"
|
heightClass = "collapsed"
|
||||||
}
|
}
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let lastSelectedTaskId = selectedTaskId
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
if (selectedTaskId) {
|
if (selectedTaskId && lastSelectedTaskId != selectedTaskId) {
|
||||||
heightClass = "full"
|
heightClass = "full"
|
||||||
selectedTask = tasks.tasks.find(t => t.id == selectedTaskId) ?? null
|
selectedTask = tasks.tasks.find(t => t.id == selectedTaskId) ?? null
|
||||||
} else {
|
} else {
|
||||||
heightClass = "collapsed"
|
if ("full" == heightClass)
|
||||||
|
heightClass = "collapsed"
|
||||||
}
|
}
|
||||||
|
lastSelectedTaskId = selectedTaskId
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
location.hash = ""
|
|
||||||
heightClass = "closed"
|
heightClass = "closed"
|
||||||
window.setTimeout(() => window.scrollTo({
|
window.setTimeout(() => window.scrollTo({
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
behavior: 'smooth'
|
behavior: 'smooth'
|
||||||
}), 100)
|
}), 100)
|
||||||
|
location.hash = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleKeydown(e: KeyboardEvent) {
|
function handleKeydown(e: KeyboardEvent) {
|
||||||
|
|
Reference in a new issue