attachments: provide correct context for alt/title attributes instead of the previous hack

This commit is contained in:
William Pitcock 2019-02-18 05:03:26 +00:00
parent 962a33f887
commit 7f0fef8f9b
3 changed files with 6 additions and 5 deletions

View File

@ -25,9 +25,9 @@
class="image-attachment"
:class="{'hidden': hidden && preloadImage }"
:href="attachment.url" target="_blank"
:title="attachment.description"
>
<StillImage :referrerpolicy="referrerpolicy" :mimetype="attachment.mimetype" :src="attachment.large_thumb_url || attachment.url"/>
<StillImage :referrerpolicy="referrerpolicy" :mimetype="attachment.mimetype" :src="attachment.large_thumb_url || attachment.url"
:alt="attachment.description"/>
</a>
<a class="video-container"

View File

@ -3,7 +3,8 @@ const StillImage = {
'src',
'referrerpolicy',
'mimetype',
'imageLoadError'
'imageLoadError',
'alt'
],
data () {
return {

View File

@ -1,7 +1,7 @@
<template>
<div class='still-image' :class='{ animated: animated }'>
<canvas ref="canvas" v-if="animated"></canvas>
<img ref="src" :src="src" :referrerpolicy="referrerpolicy" v-on:load="onLoad" @error="onError"/>
<img ref="src" :alt="alt" :title="alt" :src="src" :referrerpolicy="referrerpolicy" v-on:load="onLoad" @error="onError"/>
</div>
</template>