Skip to content

Commit

Permalink
Merge pull request #1381 from nextcloud/feat/accessibility-alt
Browse files Browse the repository at this point in the history
Add alt tag to img
  • Loading branch information
skjnldsv authored Sep 21, 2022
2 parents 51af5ab + 96c54da commit 29120be
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

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 29120be

Please sign in to comment.