Skip to content

Commit

Permalink
New: aria-expanded attribute true/false to match drawer visibility (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-allen-89 authored Aug 16, 2023
1 parent 54def7a commit 222968e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/adapt-languagePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ class LanguagePicker extends Backbone.Controller {
const languagePickerNavView = new LanguagePickerNavView({
model: this.languagePickerModel,
attributes: {
'aria-label': navigationBarLabel
'aria-label': navigationBarLabel,
'aria-expanded': false
}
});

Expand Down
10 changes: 9 additions & 1 deletion js/languagePickerNavView.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@ export default class LanguagePickerNavView extends Backbone.View {
}

initialize() {
this.listenTo(Adapt, 'remove', this.remove);
this.listenTo(Adapt, {
remove: this.remove,
'drawer:closed': this.onClose
});
}

onClose() {
this.$el.attr('aria-expanded', false);
}

onClick(event) {
this.$el.attr('aria-expanded', true);
drawer.triggerCustomView(new LanguagePickerDrawerView({ model: this.model }).$el, false);
}

Expand Down

0 comments on commit 222968e

Please sign in to comment.