Skip to content
Snippets Groups Projects
Commit f2997eda authored by alexisben's avatar alexisben
Browse files

fix menu breakpoint

parent 23b80904
No related branches found
No related tags found
No related merge requests found
import { breakpoints } from '../utils/breakpoints';
import { breakpoints, isMobile } from '../utils/breakpoints';
import { a11yClick } from '../utils/a11y';
const CLASSES = {
......@@ -59,16 +59,15 @@ class MainMenu {
}
resize () {
const isMobile = window.innerWidth <= breakpoints.md;
document.documentElement.style.setProperty('--header-height', this.element.offsetHeight + 'px');
document.documentElement.style.setProperty('--header-menu-max-height', (window.innerHeight - this.element.offsetHeight) + 'px');
// is state changed ?
if (this.state.isMobile === isMobile) {
if (this.state.isMobile === isMobile()) {
return null;
}
this.state.isMobile = isMobile;
this.state.isMobile = isMobile();
this.closeEverything();
}
......
......@@ -8,7 +8,7 @@ const breakpoints = {
};
const isMobile = function() {
return window.innerWidth <= breakpoints.md
return window.innerWidth <= breakpoints.lg
}
export {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment