Merge pull request #19761 from eduNEXT/lmm/courseoutline_translations

Fix Collapse All/Expand All translation
This commit is contained in:
Ned Batchelder
2019-02-11 08:12:00 -05:00
committed by GitHub

View File

@@ -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) => {