Hide task elements while the task is loading

This commit is contained in:
kolaente 2021-01-21 20:20:51 +01:00
parent a8ada57e81
commit 0d34d01689
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 26 additions and 3 deletions

View File

@ -200,7 +200,24 @@
} }
.task-view-container { .task-view-container {
padding-bottom: 1em; padding-bottom: 1rem;
.task-view * {
opacity: 0;
transition: opacity 50ms ease;
}
&.is-loading {
opacity: 1;
.task-view * {
opacity: 0;
}
}
&.visible:not(.is-loading) .task-view * {
opacity: 1;
}
} }
.is-done { .is-done {

View File

@ -31,7 +31,8 @@ $vikunja-nav-background: $light-background;
$vikunja-nav-color: lighten($black, 25); $vikunja-nav-color: lighten($black, 25);
$vikunja-nav-selected-width: 0.4em; $vikunja-nav-selected-width: 0.4em;
$transition: 150ms ease; $transition-duration: 150ms;
$transition: $transition-duration ease;
$multiselect-primary: $green; $multiselect-primary: $green;
$multiselect-dark: #35495e; $multiselect-dark: #35495e;

View File

@ -1,5 +1,5 @@
<template> <template>
<div :class="{ 'is-loading': taskService.loading}" class="loader-container task-view-container"> <div :class="{ 'is-loading': taskService.loading, 'visible': visible}" class="loader-container task-view-container">
<div class="task-view"> <div class="task-view">
<heading v-model="task" :can-write="canWrite" ref="heading"/> <heading v-model="task" :can-write="canWrite" ref="heading"/>
<h6 class="subtitle" v-if="parent && parent.namespace && parent.list"> <h6 class="subtitle" v-if="parent && parent.namespace && parent.list">
@ -458,6 +458,8 @@ export default {
showDeleteModal: false, showDeleteModal: false,
descriptionChanged: false, descriptionChanged: false,
listViewName: 'list.list', listViewName: 'list.list',
// Used to avoid flashing of empty elements if the task content is not yet loaded.
visible: false,
priorities: priorites, priorities: priorites,
activeFields: { activeFields: {
@ -492,6 +494,8 @@ export default {
this.listViewName = `list.${parts[1]}` this.listViewName = `list.${parts[1]}`
} }
console.log(this.task)
this.loadTask() this.loadTask()
}, },
computed: { computed: {
@ -543,6 +547,7 @@ export default {
this.error(e, this) this.error(e, this)
}) })
.finally(() => { .finally(() => {
this.$nextTick(() => this.visible = true)
this.scrollToHeading() this.scrollToHeading()
}) })
}, },