X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=ui%2Ftopmenu.py;h=1be7c2857443cb14ef72297584d974204484f0ac;hb=2cbdcad141edc8fe25af7e4cb22c657b48c96dd1;hp=e6250f0562b261f8b1ebb405880a90ffd2777f34;hpb=194f64e52b806bafa5a5e0ed2940b94a462fe87e;p=myslice.git diff --git a/ui/topmenu.py b/ui/topmenu.py index e6250f05..1be7c285 100644 --- a/ui/topmenu.py +++ b/ui/topmenu.py @@ -31,12 +31,15 @@ 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 + print 'mark_active OUT','d=',d,'up',up 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):