Merge branch 'master' of ssh://git.onelab.eu/git/myslice
[myslice.git] / ui / topmenu.py
index e6250f0..3a94a21 100644 (file)
@@ -31,12 +31,14 @@ def topmenu_items (current,request=None):
     if current is not None:
         current=current.lower()
         curlen=len(current)
-        def mark_active(d):
-            if d['label'][:curlen].lower() == current: d['is_active']=True
+        def mark_active(d,up=None):
+            if d['label'][:curlen].lower() == current: 
+                d['is_active']=True
+                if up is not None: up['is_active']=True
         for d in result:
             mark_active(d)
             if 'dropdown' in d:
-                for dd in d['contents']: mark_active(dd)
+                for dd in d['contents']: mark_active(dd,d)
     return result
 
 def the_user (request):