File tree Expand file tree Collapse file tree 2 files changed +24
-25
lines changed Expand file tree Collapse file tree 2 files changed +24
-25
lines changed Original file line number Diff line number Diff line change @@ -505,6 +505,30 @@ atomic-search-layout atomic-layout-section[section="search"] {
505505 z-index : 9999 ;
506506}
507507
508+ header atomic-search-interface {
509+ /* Hide by default */
510+ display : none;
511+ }
512+
513+ body : not (: has (.main-layout )) header atomic-search-interface {
514+ /* Show on landing pages */
515+ display : block;
516+ }
517+
518+ @media (max-width : 1184px ) {
519+ /* Show on pages with sidebar if it is hidden */
520+ body : has (.sidebar-layout ) header atomic-search-interface {
521+ display : block;
522+ }
523+ }
524+
525+ @media (max-width : 1023px ) {
526+ /* Show on search page with facet if it is hidden */
527+ body : has (atomic-search-layout ) header atomic-search-interface {
528+ display : block;
529+ }
530+ }
531+
508532/* Sidebar */
509533.sidebar {
510534 display : flex;
Original file line number Diff line number Diff line change @@ -85,8 +85,6 @@ async function atomicCoveo() {
8585 } ,
8686 } ) ;
8787
88- searchBarHeader . style . display =
89- sidebar || searchPageInterface ? 'none' : 'block' ;
9088 await searchBarHeader . executeFirstSearch ( ) ;
9189}
9290
@@ -158,26 +156,3 @@ document.addEventListener('DOMContentLoaded', async () => {
158156 legacyCoveo ( ) ;
159157 }
160158} ) ;
161-
162- window . addEventListener ( 'resize' , ( event ) => {
163- const searchBarHeader = document . querySelector ( '#search-standalone-header' ) ;
164- const searchPageInterface = document . querySelector ( '#search-v2' ) ;
165- const searchPageSearchbar = document . querySelector (
166- '#search-standalone-searchpage'
167- ) ;
168- const sidebar = document . querySelector ( '#sidebar-layout' ) ;
169-
170- if ( ! sidebar && ! searchPageInterface ) {
171- // Show when there is no sidebar or on the search page
172- searchBarHeader . style . display = 'block' ;
173- } else if ( sidebar && sidebar . offsetWidth === 0 ) {
174- // Show when there is a sidebar but is hidden due to resizing
175- searchBarHeader . style . display = 'block' ;
176- } else if ( searchPageInterface && searchPageSearchbar . offsetWidth === 0 ) {
177- // Show when on the search page but is "sidebar" searchbar is hidden
178- searchBarHeader . style . display = 'block' ;
179- } else {
180- // Go back to default state
181- searchBarHeader . style . display = 'none' ;
182- }
183- } ) ;
You can’t perform that action at this time.
0 commit comments