Ticket #53951: 53951.2.diff
File 53951.2.diff, 1.9 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 var toggles; 682 681 683 if ( element.classList.contains( 'close-search-toggle' ) ) { 682 684 return; 683 685 } … … 687 689 if ( falseVal === undefined ) { 688 690 falseVal = false; 689 691 } 690 if ( element.getAttribute( attribute ) !== trueVal ) { 691 element.setAttribute( attribute, trueVal ); 692 } else { 693 element.setAttribute( attribute, falseVal ); 694 } 692 693 /* 694 * Take into account multiple toggle elements that need their state to be 695 * synced. For example: the Search toggle buttons for desktop and mobile. 696 */ 697 toggles = document.querySelectorAll( '[data-toggle-target="' + element.dataset.toggleTarget + '"]' ); 698 699 toggles.forEach( function( toggle ) { 700 if ( toggle.getAttribute( attribute ) !== trueVal ) { 701 toggle.setAttribute( attribute, trueVal ); 702 } else { 703 toggle.setAttribute( attribute, falseVal ); 704 } 705 } ); 695 706 } 696 707 697 708 /** -
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