mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
DockedMegaMenu: Adjust docked threshold (#77139)
* adjust docked threshold to be xl instead of md and make sure it's open by default on 1440 res * don't show dock menu button
This commit is contained in:
parent
2a43ee5d46
commit
85468d2a67
@ -41,10 +41,10 @@ export function AppChrome({ children }: Props) {
|
|||||||
chrome.setMegaMenu('closed');
|
chrome.setMegaMenu('closed');
|
||||||
break;
|
break;
|
||||||
case 'docked':
|
case 'docked':
|
||||||
// on desktop, clicking the button when the menu is docked should close the menu
|
// on large screens, clicking the button when the menu is docked should close the menu
|
||||||
// on mobile, the docked menu is hidden, so clicking the button should open the menu
|
// on smaller screens, the docked menu is hidden, so clicking the button should open the menu
|
||||||
const isDesktop = window.innerWidth > theme.breakpoints.values.md;
|
const isLargeScreen = window.innerWidth >= theme.breakpoints.values.xl;
|
||||||
isDesktop ? chrome.setMegaMenu('closed') : chrome.setMegaMenu('open');
|
isLargeScreen ? chrome.setMegaMenu('closed') : chrome.setMegaMenu('open');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -131,7 +131,7 @@ const getStyles = (theme: GrafanaTheme2) => {
|
|||||||
display: 'none',
|
display: 'none',
|
||||||
zIndex: theme.zIndex.navbarFixed,
|
zIndex: theme.zIndex.navbarFixed,
|
||||||
|
|
||||||
[theme.breakpoints.up('md')]: {
|
[theme.breakpoints.up('xl')]: {
|
||||||
display: 'block',
|
display: 'block',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
@ -35,7 +35,7 @@ export class AppChromeService {
|
|||||||
searchBarHidden: store.getBool(this.searchBarStorageKey, false),
|
searchBarHidden: store.getBool(this.searchBarStorageKey, false),
|
||||||
megaMenu:
|
megaMenu:
|
||||||
config.featureToggles.dockedMegaMenu &&
|
config.featureToggles.dockedMegaMenu &&
|
||||||
store.getBool(DOCKED_LOCAL_STORAGE_KEY, window.innerWidth > config.theme2.breakpoints.values.xxl)
|
store.getBool(DOCKED_LOCAL_STORAGE_KEY, window.innerWidth >= config.theme2.breakpoints.values.xxl)
|
||||||
? 'docked'
|
? 'docked'
|
||||||
: 'closed',
|
: 'closed',
|
||||||
kioskMode: null,
|
kioskMode: null,
|
||||||
|
@ -117,7 +117,7 @@ const getStyles = (theme: GrafanaTheme2) => ({
|
|||||||
dockMenuButton: css({
|
dockMenuButton: css({
|
||||||
display: 'none',
|
display: 'none',
|
||||||
|
|
||||||
[theme.breakpoints.up('md')]: {
|
[theme.breakpoints.up('xl')]: {
|
||||||
display: 'inline-flex',
|
display: 'inline-flex',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
Loading…
Reference in New Issue
Block a user