X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ui%2Ftopmenu.py;h=3a94a212825e338dc1d00d1ea481d5fde453fd3d;hb=a0fd5fbe2c8a1acc16ed233058bde1339e843b40;hp=e6250f0562b261f8b1ebb405880a90ffd2777f34;hpb=83f3bc8abee6f1312ad9a0a24e63871fc1ee8b16;p=unfold.git diff --git a/ui/topmenu.py b/ui/topmenu.py index e6250f05..3a94a212 100644 --- a/ui/topmenu.py +++ b/ui/topmenu.py @@ -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):