Ticket #53951: 53951.4.diff
File 53951.4.diff, 3.0 KB (added by , 3 years ago) |
---|
-
src/wp-content/themes/twentytwenty/assets/js/index.js
678 678 /* Toggle an attribute ----------------------- */ 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; 686 689 } … … 687 690 if ( falseVal === undefined ) { 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 697 713 /** -
src/wp-content/themes/twentytwenty/template-parts/modal-menu.php
17 17 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' ); ?> 23 23 </button><!-- .nav-toggle --> -
src/wp-content/themes/twentytwenty/template-parts/modal-search.php
8 8 */ 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"> 14 14