Changeset 53051
- Timestamp:
- 04/01/2022 05:54:30 PM (3 years ago)
- Location:
- trunk/src/wp-content/themes/twentytwenty
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentytwenty/assets/js/index.js
r51322 r53051 679 679 680 680 function twentytwentyToggleAttribute( element, attribute, trueVal, falseVal ) { 681 if ( element.classList.contains( 'close-search-toggle' ) ) { 681 var toggles; 682 683 if ( ! element.hasAttribute( attribute ) ) { 682 684 return; 683 685 } 686 684 687 if ( trueVal === undefined ) { 685 688 trueVal = true; … … 688 691 falseVal = false; 689 692 } 690 if ( element.getAttribute( attribute ) !== trueVal ) { 691 element.setAttribute( attribute, trueVal ); 692 } else { 693 element.setAttribute( attribute, falseVal ); 694 } 693 694 /* 695 * Take into account multiple toggle elements that need their state to be 696 * synced. For example: the Search toggle buttons for desktop and mobile. 697 */ 698 toggles = document.querySelectorAll( '[data-toggle-target="' + element.dataset.toggleTarget + '"]' ); 699 700 toggles.forEach( function( toggle ) { 701 if ( ! toggle.hasAttribute( attribute ) ) { 702 return; 703 } 704 705 if ( toggle.getAttribute( attribute ) !== trueVal ) { 706 toggle.setAttribute( attribute, trueVal ); 707 } else { 708 toggle.setAttribute( attribute, falseVal ); 709 } 710 } ); 695 711 } 696 712 -
trunk/src/wp-content/themes/twentytwenty/template-parts/modal-menu.php
r51967 r53051 18 18 <div class="menu-top"> 19 19 20 <button class="toggle close-nav-toggle fill-children-current-color" data-toggle-target=".menu-modal" data-toggle-body-class="showing-menu-modal" aria-expanded="false"data-set-focus=".menu-modal">20 <button class="toggle close-nav-toggle fill-children-current-color" data-toggle-target=".menu-modal" data-toggle-body-class="showing-menu-modal" data-set-focus=".menu-modal"> 21 21 <span class="toggle-text"><?php _e( 'Close Menu', 'twentytwenty' ); ?></span> 22 22 <?php twentytwenty_the_theme_svg( 'cross' ); ?> -
trunk/src/wp-content/themes/twentytwenty/template-parts/modal-search.php
r50933 r53051 9 9 10 10 ?> 11 <div class="search-modal cover-modal header-footer-group" data-modal-target-string=".search-modal" >11 <div class="search-modal cover-modal header-footer-group" data-modal-target-string=".search-modal" role="dialog" aria-modal="true" aria-label="<?php esc_attr_e( 'Search', 'twentytwenty' ); ?>"> 12 12 13 13 <div class="search-modal-inner modal-inner">
Note: See TracChangeset
for help on using the changeset viewer.