File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -273,10 +273,8 @@ def generate_toctree_html(
273
273
274
274
# Open the sidebar navigation to the proper depth
275
275
for ii in range (int (show_nav_level )):
276
- for checkbox in soup .select (
277
- f"li.toctree-l{ ii } > input.toctree-checkbox"
278
- ):
279
- checkbox .attrs ["checked" ] = None
276
+ for details in soup .select (f"li.toctree-l{ ii } > details" ):
277
+ details ["open" ] = None
280
278
281
279
return soup
282
280
@@ -363,7 +361,7 @@ def add_collapse_checkboxes(soup: BeautifulSoup) -> None:
363
361
if "current" in classes :
364
362
parentli = element .find_parent ("li" , class_ = "toctree-l0" )
365
363
if parentli :
366
- parentli .find ("details" )["open" ] = True
364
+ parentli .find ("details" )["open" ] = None
367
365
368
366
# Nothing more to do, unless this has "children"
369
367
subtree = element .find ("ul" )
@@ -411,7 +409,7 @@ def add_collapse_checkboxes(soup: BeautifulSoup) -> None:
411
409
# If this has a "current" class, be expanded by default
412
410
# (by opening the details/summary disclosure widget)
413
411
if "current" in classes :
414
- details ["open" ] = True
412
+ details ["open" ] = None
415
413
416
414
417
415
def get_local_toctree_for (
You can’t perform that action at this time.
0 commit comments