Skip to content

Commit 5640dd4

Browse files
authored
Fix Vue menu issues (#81)
* Fix Vue menu selection highlighting * Fix menu behaviour on changing width * Fix menu tree collapsing
1 parent b164cba commit 5640dd4

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

templates/vue/application/src/components/side-nav-menu.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
@initialized="handleMenuInitialized"
1515
@item-click="handleItemClick"
1616
@selection-changed="handleSelectionChange"
17+
@content-ready="handleSelectionChange"
1718
/>
1819
</div>
1920
</div>
@@ -82,12 +83,19 @@ export default {
8283
},
8384
8485
updateSelection() {
86+
if (!this.treeView) {
87+
return;
88+
}
89+
8590
this.treeView.selectItem(this.$route.path);
8691
}
8792
},
8893
mounted() {
8994
this.treeView = this.$refs[treeViewRef] && this.$refs[treeViewRef].instance;
9095
this.updateSelection();
96+
if (this.compactMode) {
97+
this.treeView.collapseAll();
98+
}
9199
},
92100
watch: {
93101
$route() {

templates/vue/application/src/layouts/side-nav-inner-toolbar.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ export default {
110110
},
111111
watch: {
112112
isLarge() {
113-
this.menuOpened = this.isLarge;
113+
if (!this.menuTemporaryOpened) {
114+
this.menuOpened = this.isLarge;
115+
}
114116
},
115117
$route() {
116118
if (this.menuTemporaryOpened || !this.isLarge) {

templates/vue/application/src/layouts/side-nav-outer-toolbar.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ export default {
8989
},
9090
watch: {
9191
isLarge() {
92-
this.menuOpened = this.isLarge;
92+
if (!this.menuTemporaryOpened) {
93+
this.menuOpened = this.isLarge;
94+
}
9395
},
9496
$route() {
9597
if (this.menuTemporaryOpened || !this.isLarge) {

0 commit comments

Comments
 (0)