Skip to content

Commit

Permalink
Add alt tag to img
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Sep 21, 2022
1 parent 51af5ab commit 86f90ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Images.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
@close="onClose" />

<img v-else
:alt="alt"
:class="{
dragging,
loaded,
Expand All @@ -51,6 +52,7 @@ import axios from '@nextcloud/axios'
import Vue from 'vue'
import AsyncComputed from 'vue-async-computed'
import ImageEditor from './ImageEditor.vue'
import { basename } from '@nextcloud/paths'
Vue.use(AsyncComputed)
Expand Down Expand Up @@ -90,6 +92,10 @@ export default {
zoomWidth() {
return Math.round(this.width * this.zoomRatio)
},
alt() {
const fileName = basename(this.src)
return t('viewer', `Content of '${fileName}'`)
},
},
asyncComputed: {
Expand Down

0 comments on commit 86f90ab

Please sign in to comment.