]> source.dussan.org Git - archiva.git/commitdiff
set active class for current menu entry used
authorOlivier Lamy <olamy@apache.org>
Fri, 10 Feb 2012 18:23:14 +0000 (18:23 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 10 Feb 2012 18:23:14 +0000 (18:23 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1242876 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js

index 9df607d1cc3ad1144d10e5b7bd9fc87a76a5af93..976cc3c831f7603f9fe8bf59a2f93540387648ab 100644 (file)
@@ -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();
 })
index 7e928c67097dd8eb344fa529b5fd6e97ca6c9328..6494ebce15f5b8cd99bdb9a14c1de5553161826a 100644 (file)
@@ -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"}');