Skip to content
Snippets Groups Projects

Move search bar to top nav to test usage changes

Merged Tomas Bulva requested to merge 480341-move-search-bar-to-top-nav-to-test-usage-changes into master
1 unresolved thread
Compare and Show latest version
4 files
+ 42
10
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -102,3 +102,21 @@ export function removeListenerSystemColorSchemeChange(onEvent) {
@@ -102,3 +102,21 @@ export function removeListenerSystemColorSchemeChange(onEvent) {
.matchMedia(PREFERS_DARK)
.matchMedia(PREFERS_DARK)
.removeEventListener('change', (event) => handleColorSchemeChange(onEvent, event));
.removeEventListener('change', (event) => handleColorSchemeChange(onEvent, event));
}
}
 
 
function isNarrownScreenMediaQuery(elRef) {
 
const computedStyles = getComputedStyle(elRef);
 
const largeBreakpointSize = parseInt(computedStyles.getPropertyValue('--breakpoint-lg'), 10);
 
return window.matchMedia(`(max-width: ${largeBreakpointSize - 1}px)`);
 
}
 
 
export function isNarrowScreen(elRef) {
 
return isNarrownScreenMediaQuery(elRef).matches;
 
}
 
 
export function isNarrowScreenAddListener(elRef, handlerFn) {
 
isNarrownScreenMediaQuery(elRef).addEventListener('change', handlerFn);
 
}
 
 
export function isNarrowScreenRemoveListener(elRef, handlerFn) {
 
isNarrownScreenMediaQuery(elRef).removeEventListener('change', handlerFn);
 
}
Loading