Commit 2eff6b50 authored by jackie / Andrea Ida Malkah Klaura's avatar jackie / Andrea Ida Malkah Klaura
Browse files

FIX: use intermediate value for image src

When we use the image and logo values in the show object directly,
we get errors, when those values are 0, because they are rendered,
just not visible.

So we use intermediate values now in the this.current object, which
are set everytime the show is switched.
parent ccf390c2
......@@ -271,12 +271,12 @@
<b-badge style="width:80%;">Logo:</b-badge> <img src="../assets/16x16/emblem-system.png" alt="edit" v-on:click="$refs.appModalShow.showLogo()" />
</b-col>
<b-col lg="4">
<div v-if="shows[currentShow].logo.length === 0">
<div v-if="current.logo.length === 0">
<small><i>(none set)</i></small>
</div>
<div v-else>
<br />
<b-img thumbnail :src="shows[currentShow].logo" fluid v-on:click="$refs.appModalShow.showLogo()" />
<b-img thumbnail :src="current.logo" fluid v-on:click="$refs.appModalShow.showLogo()" />
</div>
</b-col>
......@@ -284,12 +284,12 @@
<b-badge style="width:80%;">Image:</b-badge> <img src="../assets/16x16/emblem-system.png" alt="edit" v-on:click="$refs.appModalShow.showImage()" />
</b-col>
<b-col lg="4">
<div v-if="shows[currentShow].image.length === 0">
<div v-if="current.image.length === 0">
<small><i>(none set)</i></small>
</div>
<div v-else>
<br />
<b-img thumbnail :src="shows[currentShow].image" fluid v-on:click="$refs.appModalShow.showImage()" />
<b-img thumbnail :src="current.image" fluid v-on:click="$refs.appModalShow.showImage()" />
</div>
</b-col>
</b-row>
......@@ -349,7 +349,9 @@ export default {
perpage: 10
},
note: {},
notes: []
notes: [],
image: '',
logo: ''
},
notesTableArrayFields: [
{ key: 'title', label: 'Title of emission' },
......@@ -421,6 +423,12 @@ export default {
// set the current show and its ID to whatever we want to switch to now
this.currentShow = index
this.currentShowID = this.shows[this.currentShow].id
// and check if images are available and set image strings, because we
// cannot use them directly inside the b-img if they are null
if (this.shows[this.currentShow].logo === null) this.current.logo = ''
else this.current.logo = this.shows[this.currentShow].logo
if (this.shows[this.currentShow].image === null) this.current.image = ''
else this.current.image = this.shows[this.currentShow].image
// before we load timeslots and notes, we want to fetch the general settings first
this.getCategories()
this.getHosts()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment