@@ -51,7 +51,7 @@ namespace Volo.Docs.Areas.Documents.Helpers.TagHelpers
{
var content = "";
- var isAnyNodeOpenedInThisLevel = node.Items?.Any(n => n.IsOpened(SelectedDocumentName)) ?? false;
+ var isAnyNodeOpenedInThisLevel = node.Items?.Any(n => n.IsSelected(SelectedDocumentName)) ?? false;
node.Items?.ForEach(innerNode =>
{
@@ -72,11 +72,12 @@ namespace Volo.Docs.Areas.Documents.Helpers.TagHelpers
private string GetLeafNode(NavigationNode node, string content)
{
- var cssClass = node.Path.IsNullOrEmpty() ? "tree-toggle" : "";
+ var anchorCss = node.Path.IsNullOrEmpty() ? "tree-toggle" : "";
+ var isNodeSelected = node.IsSelected(SelectedDocumentName);
- if (node.IsOpened(SelectedDocumentName))
+ if (isNodeSelected)
{
- cssClass += " opened";
+ anchorCss += " opened";
}
return string.Format(LiItemTemplate,
@@ -85,7 +86,8 @@ namespace Volo.Docs.Areas.Documents.Helpers.TagHelpers
content,
node.HasChildItems ? "nav-header" : "last-link",
node.HasChildItems ? "chevron-down" : "long-arrow-right",
- cssClass);
+ anchorCss ,
+ isNodeSelected? "selected-tree" : "");
}
}
diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml
index 319dc4d3d4..b5c1b83a2f 100644
--- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml
+++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml
@@ -72,7 +72,6 @@
}
+ @* @if (Model.Versions.Any())
+ {
+
+
+
+ } *@
Versions { get; private set; }
+ public List VersionSelectItems => Versions.Select(v => new SelectListItem
+ {
+ Text = v.DisplayText,
+ Value = "/documents/" + ProjectName + "/" + v.Version + "/" + DocumentName,
+ Selected = v.IsSelected
+ }).ToList();
+
public NavigationWithDetailsDto Navigation { get; private set; }
private readonly IDocumentAppService _documentAppService;
@@ -95,7 +103,5 @@ namespace Volo.Docs.Pages.Documents.Project
Versions.Insert(0, DocsWebConsts.DefaultVersion);
}
-
-
}
}
\ No newline at end of file