Commit 86227e4c authored by Coung Ngo's avatar Coung Ngo

Update settings_dropdown.vue to use text-sr-only attribute

Now that GlDropdown can show SR only text, this commit updates
the code to do it in this fashion
parent c6e7be4d
<script>
import { mapActions, mapGetters, mapState } from 'vuex';
import { GlButtonGroup, GlButton, GlDropdown } from '@gitlab/ui';
import { __ } from '~/locale';
export default {
components: {
......@@ -13,12 +12,6 @@ export default {
...mapGetters('diffs', ['isInlineView', 'isParallelView']),
...mapState('diffs', ['renderTreeList', 'showWhitespace']),
},
mounted() {
this.patchAriaLabel();
},
updated() {
this.patchAriaLabel();
},
methods: {
...mapActions('diffs', [
'setInlineDiffViewType',
......@@ -26,17 +19,18 @@ export default {
'setRenderTreeList',
'setShowWhitespace',
]),
patchAriaLabel() {
this.$el
.querySelector('.js-show-diff-settings')
.setAttribute('aria-label', __('Diff view settings'));
},
},
};
</script>
<template>
<gl-dropdown icon="settings" toggle-class="js-show-diff-settings" right>
<gl-dropdown
icon="settings"
:text="__('Diff view settings')"
:text-sr-only="true"
toggle-class="js-show-diff-settings"
right
>
<div class="gl-px-3">
<span class="gl-font-weight-bold gl-display-block gl-mb-2">{{ __('File browser') }}</span>
<gl-button-group class="gl-display-flex">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment