Adds extra loading to prevent blinking while loading metadata in items page.

This commit is contained in:
Mateus Machado Luna 2018-08-28 09:47:35 -03:00
parent 09e57dd207
commit 8f417e5c69
1 changed files with 5 additions and 7 deletions

View File

@ -47,7 +47,6 @@ export default {
},
watch: {
'$route' (to, from) {
// Should set Collection ID from URL only when in admin.
if (this.$route.name == 'CollectionItemsPage' || this.$route.name == 'ItemsPage')
this.collectionId = !this.$route.params.collectionId ? this.$route.params.collectionId : parseInt(this.$route.params.collectionId);
@ -299,13 +298,12 @@ export default {
},
loadItems(to) {
// Forces fetch_only to be filled before any search happens
if (this.$store.getters['search/getPostQuery']['fetch_only'] == undefined) {
this.$emit( 'hasToPrepareMetadataAndFilters', to);
} else {
this.$emit( 'isLoadingItems', true);
this.$emit( 'isLoadingItems', true);
// Forces fetch_only to be filled before any search happens
if (this.$store.getters['search/getPostQuery']['fetch_only'] == undefined) {
this.$emit( 'hasToPrepareMetadataAndFilters', to);
} else {
this.$store.dispatch('collection/fetchItems', {
'collectionId': this.collectionId,
'isOnTheme': (this.$route.name == null),