diff --git a/src/wp-content/themes/twentytwenty/assets/js/index.js b/src/wp-content/themes/twentytwenty/assets/js/index.js
index 0a64fd98ba..f059e13636 100644
a
|
b
|
twentytwentyDomReady( function() { |
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 | } |
… |
… |
function twentytwentyToggleAttribute( element, attribute, trueVal, falseVal ) { |
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.classList.contains( 'close-search-toggle' ) ) { |
| 701 | return; |
| 702 | } |
| 703 | if ( toggle.getAttribute( attribute ) !== trueVal ) { |
| 704 | toggle.setAttribute( attribute, trueVal ); |
| 705 | } else { |
| 706 | toggle.setAttribute( attribute, falseVal ); |
| 707 | } |
| 708 | } ); |
695 | 709 | } |
696 | 710 | |
697 | 711 | /** |
diff --git a/src/wp-content/themes/twentytwenty/template-parts/modal-search.php b/src/wp-content/themes/twentytwenty/template-parts/modal-search.php
index 32f9b51a0c..cf8d4dc6a7 100644
a
|
b
|
|
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 | |