Flatten lightbox comment into a vue component
Deploy Livetrail / deploy (push) Successful in 18s

This commit is contained in:
2026-09-09 17:27:19 +02:00
parent e2a694ba03
commit dc4480c4e2
5 changed files with 79 additions and 60 deletions
+9 -39
View File
@@ -1,12 +1,10 @@
<script>
import appIcon from '@components/AppIcon';
import projectRelTime from '@components/ProjectRelTime';
import projectMapLink from '@components/ProjectMapLink';
export default {
components: {
appIcon,
projectRelTime,
projectMapLink
},
props: {
@@ -14,19 +12,7 @@ export default {
type: String
},
emits: ['opening-lightbox'],
data() {
return {
title:''
};
},
inject: ['lang', 'isMobile'],
mounted() {
this.title =
(this.$refs.comment?this.$refs.comment.outerHTML:'') +
this.$refs[this.type=='marker'?'takenon':'postedon'].outerHTML +
this.$refs[this.type=='marker'?'postedon':'takenon'].outerHTML
;
},
methods: {
openMedia() {
this.$refs.link.click();
@@ -42,12 +28,19 @@ export default {
:data-lightbox="type+'-medias'"
:data-type="options.subtype"
:data-id="options.id_media"
:data-title="title"
:data-orientation="options.rotate"
:data-context="type"
:data-comment="options.comment"
:data-posted-on-local-time="options.posted_on_formatted_time_local"
:data-posted-on-site-time="options.posted_on_formatted_time"
:data-posted-on-day-offset="options.posted_on_day_offset"
:data-taken-on-local-time="options.taken_on_formatted_time_local"
:data-taken-on-site-time="options.taken_on_formatted_time"
:data-taken-on-day-offset="options.taken_on_day_offset"
@click="$emit('opening-lightbox', $event)"
ref="link"
>
<img
<img
:src="options.thumb_path"
:width="options.width"
:height="options.height"
@@ -65,27 +58,4 @@ export default {
</p>
</div>
</a>
<div style="display:none">
<span v-if="options.comment" ref="comment" class="lb-caption-line comment desktop">
<appIcon icon="post" width="fixed" size="lg" text-classes="comment-text" :text="options.comment" />
</span>
<span ref="postedon" class="lb-caption-line">
<projectRelTime
icon="upload"
titleWrapperLangId="media.posted_on"
:localTime="options.posted_on_formatted_time_local"
:siteTime="options.posted_on_formatted_time"
:offset="options.posted_on_day_offset"
/>
</span>
<span ref="takenon" class="lb-caption-line">
<projectRelTime
:icon="options.subtype+'-shot'"
:titleWrapperLangId="'media.'+options.subtype+'_taken_on'"
:localTime="options.taken_on_formatted_time_local"
:siteTime="options.taken_on_formatted_time"
:offset="options.taken_on_day_offset"
/>
</span>
</div>
</template>