Sfoglia il codice sorgente

Merge pull request #5947 from maco/popover-on-shared-post

[improvement] in notifications sidebar, show popover on shared posts too, not just liked posts
daniel 2 mesi fa
parent
commit
8975b8e300
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. 7 1
      resources/assets/components/sections/Notifications.vue

+ 7 - 1
resources/assets/components/sections/Notifications.vue

@@ -108,7 +108,13 @@
 									</div>
 									</div>
 									<div v-else-if="n.type == 'share'">
 									<div v-else-if="n.type == 'share'">
 										<p class="my-0">
 										<p class="my-0">
-											<a :href="getProfileUrl(n.account)" class="font-weight-bold text-dark word-break" :title="n.account.acct">{{n.account.local == false ? '@':''}}{{truncate(n.account.username)}}</a> {{ $t("notifications.shared")}} <a class="font-weight-bold" :href="getPostUrl(n.status)" @click.prevent="goToPost(n.status)">{{ $t("notifications.post")}}</a>.
+											<a :href="getProfileUrl(n.account)" class="font-weight-bold text-dark word-break" :title="n.account.acct">{{n.account.local == false ? '@':''}}{{truncate(n.account.username)}}</a> {{ $t("notifications.shared")}}
+                                            <span v-if="n.status && n.status.hasOwnProperty('media_attachments')">
+												<a class="font-weight-bold" v-bind:href="getPostUrl(n.status)" :id="'fvn-' + n.id" @click.prevent="goToPost(n.status)">{{ $t("notifications.post")}}</a>.
+												<b-popover :target="'fvn-' + n.id" title="" triggers="hover" placement="top" boundary="window">
+													<img :src="notificationPreview(n)" width="100px" height="100px" style="object-fit: cover;">
+												</b-popover>
+											</span>
 										</p>
 										</p>
 									</div>
 									</div>
 									<div v-else-if="n.type == 'modlog'">
 									<div v-else-if="n.type == 'modlog'">