Skip to content
Snippets Groups Projects
Unverified Commit 7f53c3d9 authored by Ned Batchelder's avatar Ned Batchelder Committed by GitHub
Browse files

Merge pull request #19761 from eduNEXT/lmm/courseoutline_translations

Fix Collapse All/Expand All translation
parents 7d7736c7 91ed4509
No related branches found
No related tags found
No related merge requests found
......@@ -78,16 +78,17 @@ export class CourseOutline { // eslint-disable-line import/prefer-default-expor
toggleAllButton.addEventListener('click', (event) => {
const toggleAllExpanded = toggleAllButton.getAttribute('aria-expanded') === 'true';
let sectionAction;
/* globals gettext */
if (toggleAllExpanded) {
toggleAllButton.setAttribute('aria-expanded', 'false');
sectionAction = collapseSection;
toggleAllSpan.classList.add(extraPaddingClass);
toggleAllSpan.innerText = 'Expand All';
toggleAllSpan.innerText = gettext('Expand All');
} else {
toggleAllButton.setAttribute('aria-expanded', 'true');
sectionAction = expandSection;
toggleAllSpan.classList.remove(extraPaddingClass);
toggleAllSpan.innerText = 'Collapse All';
toggleAllSpan.innerText = gettext('Collapse All');
}
const sections = Array.prototype.slice.call(document.querySelectorAll('.accordion-trigger'));
sections.forEach((sectionToggleButton) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment