Issue #3255131: Olivero: Refactor JS to make use of second argument within Element.classList.toggle()
5 open threads
Merge request reports
Activity
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), Does this need to be cast to string? This will just be a boolean but before it was
'true'
or'false'
.Edited by Dave Longchanged this line in version 2 of the diff
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( changed this line in version 2 of the diff
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()); changed this line in version 2 of the diff
added 270 commits
-
dc1daca8...66e81d7e - 268 commits from branch
project:10.0.x
- d95baa20 - Merge branch '10.0.x' of https://git.drupalcode.org/project/drupal into 3255131-olivero-refactor-js
- 5a4df737 - update with latest 10.0.x changes
-
dc1daca8...66e81d7e - 268 commits from branch
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)); changed this line in version 3 of the diff
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()); changed this line in version 4 of the diff
added 8 commits
-
5a49724b...facf805a - 7 commits from branch
project:10.0.x
- 072a2f98 - Merge branch '10.0.x' into 3255131-olivero-refactor-js
-
5a49724b...facf805a - 7 commits from branch
Please register or sign in to reply