mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
feat(ui): add settings for controlling navbar autohide
This allows to control if the navbar should hide on idle or not
This commit is contained in:
@@ -103,7 +103,11 @@ const NavBar = observer(
|
||||
return (
|
||||
<IdleTimer
|
||||
onActive={this.activityStatus.setActive}
|
||||
onIdle={this.activityStatus.setIdle}
|
||||
onIdle={() => {
|
||||
if (settingsStore.filterBarConfig.config.autohide) {
|
||||
this.activityStatus.setIdle();
|
||||
}
|
||||
}}
|
||||
timeout={
|
||||
window.innerWidth >= 768 ? DesktopIdleTimeout : MobileIdleTimeout
|
||||
}
|
||||
|
||||
@@ -70,6 +70,18 @@ class GridConfig {
|
||||
);
|
||||
}
|
||||
|
||||
class FilterBarConfig {
|
||||
config = localStored(
|
||||
"filterBarConfig",
|
||||
{
|
||||
autohide: true
|
||||
},
|
||||
{
|
||||
delay: 100
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
class Settings {
|
||||
constructor() {
|
||||
this.savedFilters = new SavedFilters();
|
||||
@@ -77,6 +89,7 @@ class Settings {
|
||||
this.alertGroupConfig = new AlertGroupConfig();
|
||||
this.gridConfig = new GridConfig();
|
||||
this.silenceFormConfig = new SilenceFormConfig();
|
||||
this.filterBarConfig = new FilterBarConfig();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user