Skip to content

Commit e9d2ab9

Browse files
committed
Sidebar: open sub-toc when clicking on a page from the sidebar
1 parent c36bc5f commit e9d2ab9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ocamlorg_frontend/components/navmap.eml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ let rec nested_render ~path (item : toc) =
6060
<span class="no-expand"><span class="<%s if item.title = fragment then "" else "opacity-80" %> <%s icon_style item.kind %>"></span></span>
6161
<span class="sm <%s title_style %>"><%s! item.title %></span>
6262
<% | Some href -> %>
63-
<a href="<%s href %>" <%s! htmx_attributes %> class="flex">
63+
<a href="<%s href %>" x-on:click="open = true" <%s! htmx_attributes %> class="flex">
6464
<span class="no-expand"><span class="<%s if item.title = fragment then "" else "opacity-80" %> <%s icon_style item.kind %>"></span></span>
6565
</a>
66-
<a href="<%s href %>" <%s! htmx_attributes %> class="<%s title_style %> overflow-hidden truncate text-title dark:text-dark-title transition-colors hover:text-primary">
66+
<a href="<%s href %>" x-on:click="open = true" <%s! htmx_attributes %> class="<%s title_style %> overflow-hidden truncate text-title dark:text-dark-title transition-colors hover:text-primary">
6767
<%s! item.title %>
6868
</a>
6969
<% ); %>
@@ -89,7 +89,7 @@ let rec nested_render ~path (item : toc) =
8989
</span>
9090
<span x-on:click="open = ! open" class="arrow-expand mr-2" :class="open ? 'open' : ''"><%s! Icons.chevron_down "h-5 w-5" %></span>
9191
<% | Some href -> %>
92-
<a href="<%s href %>" <%s! htmx_attributes %> class="<%s title_style %> overflow-hidden truncate text-title dark:text-dark-title transition-colors hover:text-primary">
92+
<a href="<%s href %>" x-on:click="open = true" <%s! htmx_attributes %> class="<%s title_style %> overflow-hidden truncate text-title dark:text-dark-title transition-colors hover:text-primary">
9393
<%s! item.title %>
9494
</a>
9595
<span x-on:click="open = ! open" class="sign-expand mr-2" :class="open ? 'open' : ''"></span>

0 commit comments

Comments
 (0)