File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -82,10 +82,20 @@ def _get_url(self, item_dict):
82
82
83
83
def _is_selected (self , item_dict ):
84
84
"""
85
- Given a menu item dictionary, it returns true if `url` is on path.
85
+ Given a menu item dictionary, it returns true if `url` is on path,
86
+ unless the item is marked as a root, in which case returns true if `url` is part of path.
86
87
"""
87
88
url = self ._get_url (item_dict )
88
- return url == self .path
89
+ if self ._is_root (item_dict ):
90
+ return url in self .path
91
+ else :
92
+ return url == self .path
93
+
94
+ def _is_root (self , item_dict ):
95
+ """
96
+ Given a menu item dictionary, it returns true if item is marked as a `root`.
97
+ """
98
+ return item_dict .get ('root' , False )
89
99
90
100
def _process_breadcrums (self , menu_list ):
91
101
"""
You can’t perform that action at this time.
0 commit comments