Skip to content

Commit

Permalink
Fix selecting an accessibility theme with the keyboard
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst committed Mar 22, 2019
1 parent eb783d0 commit 6efcd7f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions apps/accessibility/js/accessibility.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/accessibility/js/accessibility.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions apps/accessibility/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ export default {
},
methods: {
selectTheme(id) {
console.debug(id)
this.selectItem('theme', id);
},
selectFont(id) {
console.debug(id)
this.selectItem('font', id);
},
Expand Down
12 changes: 8 additions & 4 deletions apps/accessibility/src/components/itemPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<div class="preview-description">
<h3>{{preview.title}}</h3>
<p>{{preview.text}}</p>
<input type="checkbox" class="checkbox" :id="'accessibility-' + preview.id" :checked="selected === preview.id" />
<label :for="'accessibility-' + preview.id" @click="selectItem">{{t('accessibility', 'Enable')}} {{preview.title.toLowerCase()}}</label>
<input type="checkbox" class="checkbox" :id="'accessibility-' + preview.id" v-model="checked" @change="selectItem" />
<label :for="'accessibility-' + preview.id">{{t('accessibility', 'Enable')}} {{preview.title.toLowerCase()}}</label>
</div>
</div>
</template>
Expand All @@ -14,12 +14,16 @@
export default {
name: 'itemPreview',
props: ['preview', 'selected'],
data() {
return {
checked: this.selected === this.preview.id,
};
},
methods: {
selectItem() {
this.$emit(
'select',
// if we clicked the already selected one: disable it
this.preview.id === this.selected ? false : this.preview.id
this.checked ? this.preview.id : false
);
}
}
Expand Down

0 comments on commit 6efcd7f

Please sign in to comment.