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="image-attachment"
:class="{'hidden': hidden && preloadImage }" :class="{'hidden': hidden && preloadImage }"
:href="attachment.url" target="_blank" :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>
<a class="video-container" <a class="video-container"

View file

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

View file

@ -1,7 +1,7 @@
<template> <template>
<div class='still-image' :class='{ animated: animated }' > <div class='still-image' :class='{ animated: animated }'>
<canvas ref="canvas" v-if="animated"></canvas> <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> </div>
</template> </template>