Skip to content

Commit 86f90ab

Browse files
committed
Add alt tag to img
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
1 parent 51af5ab commit 86f90ab

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/components/Images.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
@close="onClose" />
2929

3030
<img v-else
31+
:alt="alt"
3132
:class="{
3233
dragging,
3334
loaded,
@@ -51,6 +52,7 @@ import axios from '@nextcloud/axios'
5152
import Vue from 'vue'
5253
import AsyncComputed from 'vue-async-computed'
5354
import ImageEditor from './ImageEditor.vue'
55+
import { basename } from '@nextcloud/paths'
5456
5557
Vue.use(AsyncComputed)
5658
@@ -90,6 +92,10 @@ export default {
9092
zoomWidth() {
9193
return Math.round(this.width * this.zoomRatio)
9294
},
95+
alt() {
96+
const fileName = basename(this.src)
97+
return t('viewer', `Content of '${fileName}'`)
98+
},
9399
},
94100
95101
asyncComputed: {

0 commit comments

Comments
 (0)