Skip to content

Commit

Permalink
Fix: Support level course in a11y.ariaLevel (fixes #453) (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster authored Mar 25, 2024
1 parent 37ed8d0 commit 32cfef6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/a11y.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ class A11y extends Backbone.Controller {
level = '1',
override = null
} = {}) {
if (level === 'course') level = 'menu';
if (arguments.length === 2) {
// backward compatibility
level = arguments[0];
Expand Down Expand Up @@ -443,7 +444,7 @@ class A11y extends Backbone.Controller {

const isInDOM = Boolean($element.parents('body').length);
if (!isInDOM) return false;

const isNotVisible = $branch.toArray().some(item => {
const style = window.getComputedStyle(item);
// make sure item is not explicitly invisible
Expand Down
1 change: 0 additions & 1 deletion js/views/headingView.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class HeadingView extends Backbone.View {
const isBackwardCompatible = [...this.$el[0].classList].every(name => !name.includes('-inner'));
data._isBackwardCompatible = isBackwardCompatible;
if (customHeadingType) data._type = customHeadingType;
if (data._type === 'course') data._type = 'menu';
this.$el.html(template(data));
this.checkCompletion();
}
Expand Down

0 comments on commit 32cfef6

Please sign in to comment.