forked from vikunja/frontend
Compare commits
3 Commits
main
...
fix/load-l
Author | SHA1 | Date |
---|---|---|
kolaente | 9c1464381c | |
kolaente | fc62016130 | |
kolaente | faf8f2b1a5 |
|
@ -166,6 +166,11 @@ store.dispatch('labels/loadAllLabels')
|
||||||
padding: $navbar-height + 1.5rem 1.5rem 1rem 1.5rem;
|
padding: $navbar-height + 1.5rem 1.5rem 1rem 1.5rem;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
|
||||||
|
// Used to make sure the spinner is always in the middle while loading
|
||||||
|
> .loader-container {
|
||||||
|
min-height: calc(100vh - #{$navbar-height + 1.5rem + 1rem});
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: $tablet) {
|
@media screen and (max-width: $tablet) {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
padding-top: 1.5rem;
|
padding-top: 1.5rem;
|
||||||
|
|
|
@ -41,17 +41,17 @@
|
||||||
</message>
|
</message>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
<router-view/>
|
<router-view v-if="listLoaded"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Message from '@/components/misc/message'
|
import Message from '@/components/misc/message'
|
||||||
import ListModel from '../../models/list'
|
import ListModel from '@/models/list'
|
||||||
import ListService from '../../services/list'
|
import ListService from '@/services/list'
|
||||||
import {CURRENT_LIST} from '../../store/mutation-types'
|
import {CURRENT_LIST, BACKGROUND} from '@/store/mutation-types'
|
||||||
import {getListView} from '../../helpers/saveListView'
|
import {getListView} from '@/helpers/saveListView'
|
||||||
import {saveListToHistory} from '../../modules/listHistory'
|
import {saveListToHistory} from '@/modules/listHistory'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {Message},
|
components: {Message},
|
||||||
|
@ -144,6 +144,14 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.debug(`Loading list, $route.name = ${this.$route.name}, $route.params =`, this.$route.params, `, listLoaded = ${this.listLoaded}, currentList = `, this.currentList)
|
console.debug(`Loading list, $route.name = ${this.$route.name}, $route.params =`, this.$route.params, `, listLoaded = ${this.listLoaded}, currentList = `, this.currentList)
|
||||||
|
|
||||||
|
// Put set the current list to the one we're about to load so that the title is already shown at the top
|
||||||
|
this.listLoaded = 0
|
||||||
|
const listFromStore = this.$store.getters['lists/getListById'](listData.id)
|
||||||
|
if (listFromStore !== null) {
|
||||||
|
this.$store.commit(BACKGROUND, null)
|
||||||
|
this.$store.commit(CURRENT_LIST, listFromStore)
|
||||||
|
}
|
||||||
|
|
||||||
// We create an extra list object instead of creating it in this.list because that would trigger a ui update which would result in bad ux.
|
// We create an extra list object instead of creating it in this.list because that would trigger a ui update which would result in bad ux.
|
||||||
const list = new ListModel(listData)
|
const list = new ListModel(listData)
|
||||||
|
|
Loading…
Reference in New Issue