+
@@ -273,7 +290,7 @@
data() {
return {
namespaceService: NamespaceService,
- mobileMenuActive: false,
+ menuActive: true,
currentDate: new Date(),
userMenuActive: false,
authTypes: authTypes,
@@ -339,6 +356,11 @@
)
}
+ // Hide the menu by default on mobile
+ if (window.innerWidth < 770) {
+ this.menuActive = false
+ }
+
// Try renewing the token every time vikunja is loaded initially
// (When opening the browser the focus event is not fired)
this.$store.dispatch('auth/renewToken')
@@ -402,9 +424,13 @@
}
this.loadNamespacesIfNeeded(e)
- this.mobileMenuActive = false
this.userMenuActive = false
+ // If the menu is active on desktop, don't hide it because that would confuse the user
+ if (window.innerWidth < 770) {
+ this.menuActive = false
+ }
+
// Reset the current list highlight in menu if the current list is not list related.
if (
this.$route.name === 'home' ||
diff --git a/src/styles/theme/content.scss b/src/styles/theme/content.scss
index 22274d5e..208024c1 100644
--- a/src/styles/theme/content.scss
+++ b/src/styles/theme/content.scss
@@ -7,7 +7,10 @@
.app-content {
padding: $navbar-height + 1.5rem 1.5em 0 1.5em;
z-index: 2;
- margin-left: 17vw;
+
+ &.is-menu-enabled {
+ margin-left: 17vw;
+ }
@media screen and (max-width: $tablet) {
margin-left: 0;
diff --git a/src/styles/theme/navigation.scss b/src/styles/theme/navigation.scss
index 6ad0edb7..b8cf2c5d 100644
--- a/src/styles/theme/navigation.scss
+++ b/src/styles/theme/navigation.scss
@@ -14,6 +14,11 @@
box-shadow: $navbar-dropdown-boxed-shadow;
top: 101%;
}
+
+ .navbar-brand {
+ display: flex;
+ align-items: center;
+ }
}
.navbar.main-theme {
@@ -113,15 +118,30 @@
overflow-x: auto;
width: 17vw;
- @media screen and (max-width: $tablet) {
- padding: 0 0 1em;
- left: -147vw;
- top: 0;
- bottom: 0;
- width: 70vw;
+ padding: 0 0 1em;
+ left: -147vw;
+ bottom: 0;
- &.is-active {
- left: 0;
+ @media screen and (max-width: $tablet) {
+ top: 0;
+ width: 70vw;
+ }
+
+ &.is-active {
+ left: 0;
+ }
+
+ .collapse-menu-button {
+ font-size: .75rem;
+ color: $grey;
+ text-align: center;
+ display: block;
+ width: 100%;
+ margin: $navbar-padding / 2 0 $navbar-padding;
+ cursor: pointer;
+
+ @media screen and (max-width: $tablet) {
+ display: none;
}
}
@@ -270,7 +290,7 @@
}
.top-menu {
- margin: $navbar-padding / 2 0 $navbar-padding;
+ margin-top: $navbar-padding / 2;
.menu-list {
li {
@@ -326,7 +346,7 @@
}
}
-.mobilemenu-hide-button, .mobilemenu-show-button {
+.menu-hide-button, .menu-show-button {
display: none;
z-index: 31;
font-weight: bold;
@@ -339,7 +359,7 @@
}
}
-.mobilemenu-hide-button {
+.menu-hide-button {
position: fixed;
&:hover, &:focus {
@@ -361,13 +381,13 @@
}
@media screen and (max-width: $tablet) {
- .mobilemenu-hide-button {
+ .menu-hide-button {
display: block;
top: $hamburger-menu-icon-spacing;
right: $hamburger-menu-icon-spacing;
}
- .mobilemenu-show-button {
+ .menu-show-button {
display: block;
margin-left: $hamburger-menu-icon-spacing;
}
@@ -382,6 +402,10 @@
}
}
+.menu-show-button.is-visible {
+ display: block;
+}
+
.logout-icon {
margin-right: 0.85em !important;
}