From 2032017b0c465cdc39a632630fdc86ccd1811ac7 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 16 Jul 2018 15:13:17 +0200 Subject: [PATCH] Created new shorcut to open groups quickly --- assets/js/common/shorcuts.js | 14 ++++++++++++++ assets/js/pages/groups/pages/main.js | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/assets/js/common/shorcuts.js b/assets/js/common/shorcuts.js index 81d1ef0d..b581eb84 100644 --- a/assets/js/common/shorcuts.js +++ b/assets/js/common/shorcuts.js @@ -54,6 +54,20 @@ function openUserPageFromID(user){ return openPage("user/" + user); } +/** + * Open a group age + * + * @param {Object} info Information about the target group + */ +function openGroupPage(info){ + + if(info.virtual_directory != "null") + openPage(info.virtual_directory); + else + openPage("groups/" + info.id); + +} + /** * Check if user is signed in or not * diff --git a/assets/js/pages/groups/pages/main.js b/assets/js/pages/groups/pages/main.js index 099b9a6e..ffb68e42 100644 --- a/assets/js/pages/groups/pages/main.js +++ b/assets/js/pages/groups/pages/main.js @@ -92,7 +92,7 @@ ComunicWeb.pages.groups.pages.main = { }); groupName.addEventListener("click", function(e){ - openPage("groups/" + group.id); + openGroupPage(group); }); //Offer the user to delete its membership