Keep the main menu open on page load by default on >= desktop

This commit is contained in:
Fabio Manganiello 2022-11-26 01:15:03 +01:00
parent fecd96f64c
commit f28f08dd1a
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -74,12 +74,18 @@ export default {
return ['entities'].concat((panelNames.slice(0, homeIdx).concat(panelNames.slice(homeIdx+1))).sort())
return panelNames.sort()
},
collapsedDefault() {
if (this.isMobile() || this.isTablet())
return true
return false
},
},
methods: {
onItemClick(name) {
this.$emit('select', name)
this.collapsed = true
this.collapsed = this.isMobile() ? true : this.collapsedDefault
},
},
@ -90,6 +96,10 @@ export default {
host: null,
}
},
mounted() {
this.collapsed = this.collapsedDefault
},
}
</script>
@ -107,6 +117,13 @@ nav {
color: $nav-fg;
box-shadow: $nav-box-shadow-main;
&.collapsed {
background: $nav-bg-collapsed-mobile;
box-shadow: 1px 1px 1px 1px $default-shadow-color;
margin-bottom: 2px;
z-index: 1;
}
&:not(.collapsed) {
position: absolute;
top: 0;