Skip to content

Commit

Permalink
fix(files): Fix description for favorite images and remove image desc…
Browse files Browse the repository at this point in the history
…ription

Signed-off-by: julia.kirschenheuter <julia.kirschenheuter@nextcloud.com>
  • Loading branch information
JuliaKirschenheuter committed Jan 23, 2024
1 parent 48b3e4a commit 7ed7001
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/components/File.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
:key="`${file.basename}-small`"
:src="srcSmall"
:alt="file.basename"
:aria-describedby="ariaDescription"
:decoding="loadedSmall || isVisible ? 'sync' : 'async'"
:fetchpriority="loadedSmall || isVisible ? 'high' : 'low'"
:loading="loadedSmall || isVisible ? 'eager' : distance < 2 ? 'auto' : 'lazy'"
Expand All @@ -61,14 +60,10 @@
:decoding="loadedLarge || isVisible ? 'sync' : 'async'"
:fetchpriority="loadedLarge || isVisible ? 'high' : 'low'"
:loading="loadedLarge || isVisible ? 'auto' : 'lazy'"
:aria-describedby="ariaDescription"
@load="onLoadLarge"
@error="onErrorLarge">
</template>
</div>

<!-- image description -->
<p :id="ariaDescription" class="file__hidden-description" :class="{show: errorSmall && errorLarge}">{{ file.basename }}</p>
</a>

<NcCheckboxRadioSwitch v-if="allowSelection"
Expand Down Expand Up @@ -133,12 +128,11 @@ export default {
},

computed: {
/** @return {string} */
ariaDescription() {
return `image-description-${this.file.fileid}`
},
/** @return {string} */
ariaLabel() {
if (this.file.favorite) {
return t('photos', 'Favorite image, open the full size "{name}" image', { name: this.file.basename })
}
return t('photos', 'Open the full size "{name}" image', { name: this.file.basename })
},
/** @return {boolean} */
Expand Down

0 comments on commit 7ed7001

Please sign in to comment.