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