div for gallery was not correctly hidden

The div for the gallery was not hidden, because VueJS did evaluate
an empty list as false.
This commit is contained in:
2018-08-09 07:47:38 +02:00
parent 7ece779469
commit 1f48f7b851

View File

@@ -224,7 +224,7 @@ Vue.component('result-view-gallery', {
}, },
template: ` template: `
<div id="result-view-gallery" <div id="result-view-gallery"
v-if="gallery.tiles"> v-show="gallery.tiles">
<div <div
class="card-grid-300" class="card-grid-300"
v-show="!gallery.image"> v-show="!gallery.image">
@@ -958,7 +958,7 @@ function hidePlotAndGallery()
{ {
data.resultView.imageUrl = ''; data.resultView.imageUrl = '';
data.resultView.errorMessage = ''; data.resultView.errorMessage = '';
data.gallery.tiles = []; data.gallery.tiles = false;
data.gallery.image = ""; data.gallery.image = "";
} }
@@ -1096,6 +1096,7 @@ function createGallery(vm){
// reset progress bar // reset progress bar
data.gallery.progress.max = fieldValues.length; data.gallery.progress.max = fieldValues.length;
data.gallery.progress.value = 0; data.gallery.progress.value = 0;
data.gallery.tiles = [];
createGalleryItem(originalQuery, splitByField, imageHeight, imageWidth); createGalleryItem(originalQuery, splitByField, imageHeight, imageWidth);
}); });