Skip to content
Snippets Groups Projects

Issue #3255131: Olivero: Refactor JS to make use of second argument within Element.classList.toggle()

Issue #3255131: Olivero: Refactor JS to make use of second argument within Element.classList.toggle()

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
32 32 * The event object.
33 33 */
34 34 function handleTriggerClick(e) {
35 if (!tabs.classList.contains(expandedClass)) {
36 e.currentTarget.setAttribute('aria-expanded', 'true');
37 tabs.classList.add(expandedClass);
38 } else {
39 e.currentTarget.setAttribute('aria-expanded', 'false');
40 tabs.classList.remove(expandedClass);
41 }
35 e.currentTarget.setAttribute(
36 'aria-expanded',
37 !tabs.classList.contains(expandedClass),
  • 32 32 * The event object.
    33 33 */
    34 34 function handleTriggerClick(e) {
    35 if (!tabs.classList.contains(expandedClass)) {
    36 e.currentTarget.setAttribute('aria-expanded', 'true');
    37 tabs.classList.add(expandedClass);
    38 } else {
    39 e.currentTarget.setAttribute('aria-expanded', 'false');
    40 tabs.classList.remove(expandedClass);
    41 }
    35 e.currentTarget.setAttribute(
    36 'aria-expanded',
    37 !tabs.classList.contains(expandedClass),
    38 );
    39 tabs.classList.toggle(
  • 48 .classList.add('is-active-menu-parent');
    49 topLevelMenuItem
    50 .querySelector('[data-drupal-selector="primary-nav-menu-🥕"]')
    51 .classList.add('is-active-menu-parent');
    52 45 } else {
    53 button.setAttribute('aria-expanded', 'false');
    54 46 topLevelMenuItem.classList.remove('is-touch-event');
    55 topLevelMenuItem
    56 .querySelector('[data-drupal-selector="primary-nav-menu--level-2"]')
    57 .classList.remove('is-active-menu-parent');
    58 topLevelMenuItem
    59 .querySelector('[data-drupal-selector="primary-nav-menu-🥕"]')
    60 .classList.remove('is-active-menu-parent');
    61 47 }
    48
    49 button.setAttribute('aria-expanded', state.toString());
  • Théodore Biadala added 270 commits

    added 270 commits

    Compare with previous version

  • 32 32 * The event object.
    33 33 */
    34 34 function handleTriggerClick(e) {
    35 if (!tabs.classList.contains(expandedClass)) {
    36 e.currentTarget.setAttribute('aria-expanded', 'true');
    37 tabs.classList.add(expandedClass);
    38 } else {
    39 e.currentTarget.setAttribute('aria-expanded', 'false');
    40 tabs.classList.remove(expandedClass);
    41 }
    35 e.currentTarget.setAttribute('aria-expanded', !tabs.classList.contains(expandedClass));
    36 tabs.classList.toggle(expandedClass, !tabs.classList.contains(expandedClass));
  • 48 .classList.add('is-active-menu-parent');
    49 topLevelMenuItem
    50 .querySelector('[data-drupal-selector="primary-nav-menu-🥕"]')
    51 .classList.add('is-active-menu-parent');
    52 45 } else {
    53 button.setAttribute('aria-expanded', 'false');
    54 46 topLevelMenuItem.classList.remove('is-touch-event');
    55 topLevelMenuItem
    56 .querySelector('[data-drupal-selector="primary-nav-menu--level-2"]')
    57 .classList.remove('is-active-menu-parent');
    58 topLevelMenuItem
    59 .querySelector('[data-drupal-selector="primary-nav-menu-🥕"]')
    60 .classList.remove('is-active-menu-parent');
    61 47 }
    48
    49 button.setAttribute('aria-expanded', state.toString());
  • Andy Blum added 1 commit

    added 1 commit

    • e94cb086 - remove unnecessary second param

    Compare with previous version

  • Andy Blum added 1 commit

    added 1 commit

    Compare with previous version

  • Andy Blum added 1 commit

    added 1 commit

    Compare with previous version

  • Andy Blum added 8 commits

    added 8 commits

    Compare with previous version

  • Please register or sign in to reply
    Loading