From 462857080b444b968e80ab67781634d8c383bb57 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Mon, 14 Oct 2024 11:06:48 +0200 Subject: [PATCH] makes the parent menu point active if the child menu points gets closed --- public/js/components/Cis/Menu.js | 18 +++++++++++++++-- public/js/components/Cis/Menu/Entry.js | 28 +++++++++++++------------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/public/js/components/Cis/Menu.js b/public/js/components/Cis/Menu.js index 9608bc9de..1fd5fce96 100755 --- a/public/js/components/Cis/Menu.js +++ b/public/js/components/Cis/Menu.js @@ -24,6 +24,11 @@ export default { urlMatchRankings:[], }; }, + provide(){ + return{ + makeParentContentActive: this.makeParentContentActive, + } + }, computed:{ highestMatchingUrlCount(){ // gets the hightest ranking inside the array @@ -38,6 +43,15 @@ export default { }, }, methods:{ + makeParentContentActive(content_id, collection=this.entries, parent=null){ + for(let entry of collection){ + if(entry.content_id == content_id){ + this.activeEntry = parent; + } + this.makeParentContentActive(content_id, entry.childs, entry.content_id); + } + + }, addUrlCount(count){ this.urlMatchRankings.push(count); }, @@ -51,8 +65,8 @@ export default { }, template: /*html*/`