From 01d244386f05112caea0b4b87db3decdb3a258a8 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 9 Apr 2020 09:19:03 +0200 Subject: [PATCH] Hightlight groups & friends --- assets/js/components/sidebar/main.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/assets/js/components/sidebar/main.js b/assets/js/components/sidebar/main.js index df9ce728..4511841e 100644 --- a/assets/js/components/sidebar/main.js +++ b/assets/js/components/sidebar/main.js @@ -357,6 +357,9 @@ const SidebarMain = { flex: 2, height: "100%" }); + + // Highlight active element + SidebarMain.refreshActiveElement() }, @@ -373,6 +376,8 @@ const SidebarMain = { appendTo: target, type: "li" }); + li.setAttribute("data-membership-user-id", user.id) + let a = createElem2({ appendTo: li, @@ -471,6 +476,7 @@ const SidebarMain = { appendTo: target, type: "li" }); + li.setAttribute("data-membership-group-id", group.id) let a = createElem2({ appendTo: li, @@ -580,6 +586,14 @@ const SidebarMain = { let query = false; + // Friends + if(currPage.startsWith("user/")) + query = "[data-membership-user-id=\""+currPage.split("/")[1].split("#")[0]+"\"]" + + // Groups + if(currPage.startsWith("groups/")) + query = "[data-membership-group-id=\""+currPage.split("/")[1].split("#")[0]+"\"]" + // Conversations if(currPage.startsWith("conversations/")) query = "[data-membership-conv-id=\""+currPage.split("/")[1].split("#")[0]+"\"]"