Skip to content

Commit

Permalink
[SDPA-2730] Publication Image - if no caption, then title always show…
Browse files Browse the repository at this point in the history
…s. (#417)

* [SDPA-2730] Publication Image - if no caption, then title always shows.

* [SDPA-2730] Improve caption logic.
  • Loading branch information
alan-cole authored Jul 16, 2019
1 parent 4b8f876 commit bd2d599
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/components/Organisms/ImageGallery/FullscreenImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<div class="rpl-fullscreen-image__details-navigation">
<div class="rpl-fullscreen-image__details-navigation-count" v-if="aboveCaption">{{ aboveCaption }}</div>
<button
v-if="caption"
class="rpl-fullscreen-image__details-navigation-toggle"
:class="{ 'rpl-fullscreen-image__details-navigation-toggle--expanded': toggleCaption }"
@click="toggleCaption = !toggleCaption"
Expand All @@ -17,9 +18,9 @@
<span v-if="toggleCaption">{{ hideCaption }}</span>
</button>
</div>
<div class="rpl-fullscreen-image__details" :class="{ 'rpl-fullscreen-image__details--show': toggleCaption}">
<h2 class="rpl-fullscreen-image__title">{{ title }}</h2>
<p class="rpl-fullscreen-image__caption">{{ caption }}</p>
<div v-if="title || caption" class="rpl-fullscreen-image__details" :class="{ 'rpl-fullscreen-image__details--show': isDetailsShowing}">
<h2 v-if="title" class="rpl-fullscreen-image__title">{{ title }}</h2>
<p v-if="caption" class="rpl-fullscreen-image__caption">{{ caption }}</p>
</div>
</div>
</div>
Expand All @@ -40,6 +41,11 @@ export default {
return {
toggleCaption: false
}
},
computed: {
isDetailsShowing () {
return (this.caption) ? this.toggleCaption : true
}
}
}
</script>
Expand Down

0 comments on commit bd2d599

Please sign in to comment.