|
6 | 6 | var currentTopLevelItem = Model.TopLevelItems.FirstOrDefault(i => i.Id == Model.Tree.Id) ?? Model.Tree; |
7 | 7 | } |
8 | 8 | @if (Model.IsUsingNavigationDropdown && currentTopLevelItem is { Index: not null }) |
9 | | - { |
10 | | - <div class="sticky top-0 py-6 bg-white z-10 border-b-1 border-grey-20 pr-4"> |
11 | | - <div tabindex="0" id="pages-dropdown" class="block group border-1 border-grey-20 rounded-sm font-sans relative"> |
12 | | - <button class="w-full text-left grid grid-cols-[1fr_auto] cursor-pointer font-semibold gap-1 hover:text-black pl-4 pr-2 py-2 group-open:border-b-1 border-grey-20"> |
13 | | - <div> |
14 | | - <a |
15 | | - class="pages-dropdown_active hover:underline text-blue-elastic hover:text-blue-elastic-100" |
16 | | - href="@currentTopLevelItem.Url" |
17 | | - @Htmx.GetNavHxAttributes(true)> |
18 | | - @currentTopLevelItem.NavigationTitle |
19 | | - </a> |
20 | | - </div> |
21 | | - <div class="flex items-center justify-center size-6 hover:bg-grey-20 rounded-sm"> |
22 | | - <svg |
23 | | - xmlns="http://www.w3.org/2000/svg" |
24 | | - fill="none" |
25 | | - viewBox="0 0 24 24" |
26 | | - stroke-width="1.5" |
27 | | - stroke="currentColor" |
28 | | - class="w-4 group-open:rotate-180"> |
29 | | - <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/> |
30 | | - </svg> |
31 | | - </div> |
32 | | - </button> |
| 9 | + { |
| 10 | + <div class="sticky top-0 py-6 bg-white z-10 border-b-1 border-grey-20 pr-4"> |
| 11 | + <div tabindex="0" id="pages-dropdown" class="block group border-1 border-grey-20 rounded-sm font-sans relative"> |
| 12 | + <button class="w-full text-left grid grid-cols-[1fr_auto] cursor-pointer font-semibold gap-1 hover:text-black pl-4 pr-2 py-2 group-open:border-b-1 border-grey-20"> |
| 13 | + <div> |
| 14 | + <a |
| 15 | + class="pages-dropdown_active hover:underline text-blue-elastic hover:text-blue-elastic-100" |
| 16 | + href="@currentTopLevelItem.Url" |
| 17 | + @Htmx.GetNavHxAttributes(true)> |
| 18 | + @currentTopLevelItem.NavigationTitle |
| 19 | + </a> |
| 20 | + </div> |
| 21 | + <div class="flex items-center justify-center size-6 hover:bg-grey-20 rounded-sm"> |
| 22 | + <svg |
| 23 | + xmlns="http://www.w3.org/2000/svg" |
| 24 | + fill="none" |
| 25 | + viewBox="0 0 24 24" |
| 26 | + stroke-width="1.5" |
| 27 | + stroke="currentColor" |
| 28 | + class="w-4 group-open:rotate-180"> |
| 29 | + <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/> |
| 30 | + </svg> |
| 31 | + </div> |
| 32 | + </button> |
33 | 33 | <div class="hidden group-focus-within:block left-0 right-0 absolute top-full"> |
34 | 34 | <ul class="mt-1 py-2 bg-white border-1 border-grey-20 rounded-sm shadow-md"> |
35 | | - @foreach (var item in Model.TopLevelItems) |
36 | | - { |
| 35 | + @foreach (var item in Model.TopLevelItems) |
| 36 | + { |
37 | 37 | <li class="block"> |
38 | 38 | <a |
39 | 39 | class="block py-2 px-4 hover:underline hover:text-black hover:bg-grey-10 active:bg-blue-elastic-70 active:text-white font-semibold @(item.NavigationRoot.Id == Model.Tree.Id ? "text-blue-elastic" : "")" |
40 | 40 | href="@item.Url" |
41 | 41 | @Htmx.GetNavHxAttributes(false, "mouseover")> |
42 | | - @item.NavigationTitle |
43 | | - </a> |
44 | | - </li> |
45 | | - } |
46 | | - </ul> |
| 42 | + @item.NavigationTitle |
| 43 | + </a> |
| 44 | + </li> |
| 45 | + } |
| 46 | + </ul> |
47 | 47 | </div> |
48 | 48 | </div> |
49 | 49 | </div> |
|
57 | 57 | @Model.Title |
58 | 58 | </a> |
59 | 59 | } |
60 | | - |
61 | | - <ul class="block px-4"> |
62 | | - @await RenderPartialAsync(_TocTreeNav.Create(new NavigationTreeItem |
63 | | - { |
64 | | - IsPrimaryNavEnabled = Model.IsPrimaryNavEnabled, |
65 | | - IsGlobalAssemblyBuild = Model.IsGlobalAssemblyBuild, |
66 | | - Level = 0, |
67 | | - SubTree = Model.Tree, |
68 | | - RootNavigationId = Model.Tree.Id, |
69 | | - MaxLevel = Model.MaxLevel |
70 | | - })) |
71 | | - </ul> |
| 60 | + |
| 61 | + <ul class="block px-4"> |
| 62 | + @await RenderPartialAsync(_TocTreeNav.Create(new NavigationTreeItem |
| 63 | + { |
| 64 | + IsPrimaryNavEnabled = Model.IsPrimaryNavEnabled, |
| 65 | + IsGlobalAssemblyBuild = Model.IsGlobalAssemblyBuild, |
| 66 | + Level = 0, |
| 67 | + SubTree = Model.Tree, |
| 68 | + RootNavigationId = Model.Tree.Id, |
| 69 | + MaxLevel = Model.MaxLevel |
| 70 | + })) |
| 71 | + </ul> |
72 | 72 | </div> |
0 commit comments