Merge pull request #3116 from thelounge/xpaw/preview-label

Add aria-label on link preview toggle button
This commit is contained in:
Jérémie Astori 2019-03-16 21:40:10 -04:00 committed by GitHub
commit b06eda8471
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,7 @@
<button
v-if="link.type !== 'loading'"
:class="['toggle-button', 'toggle-preview', { opened: link.shown }]"
:aria-label="ariaLabel"
@click="onClick"
/>
</template>
@ -12,6 +13,11 @@ export default {
props: {
link: Object,
},
computed: {
ariaLabel() {
return this.link.shown ? "Collapse preview" : "Expand preview";
},
},
methods: {
onClick() {
this.link.shown = !this.link.shown;