Skip to content

Commit

Permalink
MDL-68390 js: Update to use Aria mod
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Jul 15, 2020
1 parent 4f1c8ce commit 7cc18dc
Show file tree
Hide file tree
Showing 35 changed files with 136 additions and 90 deletions.
2 changes: 1 addition & 1 deletion admin/tool/usertours/amd/build/tour.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/tool/usertours/amd/src/tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ export default class Tour {
});
}

this.listeners.forEach(function (listener) {
this.listeners.forEach(function(listener) {
listener.node.on.apply(listener.node, listener.args);
});

Expand Down
2 changes: 1 addition & 1 deletion blocks/myoverview/amd/build/view.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/myoverview/amd/build/view.min.js.map

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions blocks/myoverview/amd/src/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ define(
'core_course/events',
'block_myoverview/selectors',
'core/paged_content_events',
'core/aria',
],
function(
$,
Expand All @@ -44,7 +45,8 @@ function(
Templates,
CourseEvents,
Selectors,
PagedContentEvents
PagedContentEvents,
Aria
) {

var SELECTORS = {
Expand Down Expand Up @@ -174,12 +176,14 @@ function(
*/
var hideFavouriteIcon = function(root, courseId) {
var iconContainer = getFavouriteIconContainer(root, courseId);

var isFavouriteIcon = iconContainer.find(SELECTORS.ICON_IS_FAVOURITE);
isFavouriteIcon.addClass('hidden');
isFavouriteIcon.attr('aria-hidden', true);
Aria.hide(isFavouriteIcon);

var notFavourteIcon = iconContainer.find(SELECTORS.ICON_NOT_FAVOURITE);
notFavourteIcon.removeClass('hidden');
notFavourteIcon.attr('aria-hidden', false);
Aria.unhide(notFavourteIcon);
};

/**
Expand All @@ -190,12 +194,14 @@ function(
*/
var showFavouriteIcon = function(root, courseId) {
var iconContainer = getFavouriteIconContainer(root, courseId);

var isFavouriteIcon = iconContainer.find(SELECTORS.ICON_IS_FAVOURITE);
isFavouriteIcon.removeClass('hidden');
isFavouriteIcon.attr('aria-hidden', false);
Aria.unhide(isFavouriteIcon);

var notFavourteIcon = iconContainer.find(SELECTORS.ICON_NOT_FAVOURITE);
notFavourteIcon.addClass('hidden');
notFavourteIcon.attr('aria-hidden', true);
Aria.hide(notFavourteIcon);
};

/**
Expand Down
Loading

0 comments on commit 7cc18dc

Please sign in to comment.