Skip to content

Commit

Permalink
Merge pull request #19761 from eduNEXT/lmm/courseoutline_translations
Browse files Browse the repository at this point in the history
Fix Collapse All/Expand All translation
  • Loading branch information
nedbat authored Feb 11, 2019
2 parents 7d7736c + 91ed450 commit 7f53c3d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 7f53c3d

Please sign in to comment.