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 @@ -78,10 +78,20 @@ def _get_url(self, item_dict):
78
78
79
79
def _is_selected (self , item_dict ):
80
80
"""
81
- Given a menu item dictionary, it returns true if `url` is on path.
81
+ Given a menu item dictionary, it returns true if `url` is on path,
82
+ unless the item is marked as a root, in which case returns true if `url` is part of path.
82
83
"""
83
84
url = self ._get_url (item_dict )
84
- return url == self .path
85
+ if self ._is_root (item_dict ):
86
+ return url in self .path
87
+ else :
88
+ return url == self .path
89
+
90
+ def _is_root (self , item_dict ):
91
+ """
92
+ Given a menu item dictionary, it returns true if item is marked as a `root`.
93
+ """
94
+ return item_dict .get ('root' , False )
85
95
86
96
def _process_breadcrums (self , menu_list ):
87
97
"""
You can’t perform that action at this time.
0 commit comments