From 8a166f0520606280dbc45adb5ae2fb97d4908baf Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 10 Feb 2012 18:23:14 +0000 Subject: [PATCH] set active class for current menu entry used git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1242876 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/main.js | 10 ++++++++++ .../src/main/webapp/js/redback/users.js | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js index 9df607d1c..976cc3c83 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js @@ -173,6 +173,16 @@ $(function() { checkSecurityLinks(); checkCreateAdminLink(); $('#footer-content').html($('#footer-tmpl').tmpl(window.archivaRuntimeInfo)); + + // create handlers on menu entries to add class active on click + var alinkNodes=$("#sidebar-content #main-menu").find("li a"); + $.log("alinkNodes:"+alinkNodes.length); + alinkNodes.on("click",function(){ + $.log("click"); + alinkNodes.parent("li").removeClass("active"); + $(this).parent("li").addClass("active"); + }) + } startArchivaApplication(); }) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js index 7e928c670..6494ebce1 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js @@ -234,8 +234,7 @@ $(function() { /** * called from the menu to display tabs with users grid */ - displayUsersGrid=function(menuEntry) { - $(menuEntry).parent().addClass("active"); + displayUsersGrid=function() { screenChange(); $("#main-content").html(mediumSpinnerImg()); jQuery("#main-content").attr("data-bind",'template: {name:"usersGrid"}'); -- 2.39.5