fix #3868 - add data-enhance.nav attribute

This commit is contained in:
sbwalker
2024-02-24 09:09:15 -05:00
parent 99e032eeb7
commit 9f07f6441a
3 changed files with 9 additions and 6 deletions

View File

@ -179,9 +179,12 @@
<Label Class="col-sm-3" For="container" HelpText="Select the default container for the page" ResourceKey="DefaultContainer">Default Container: </Label> <Label Class="col-sm-3" For="container" HelpText="Select the default container for the page" ResourceKey="DefaultContainer">Default Container: </Label>
<div class="col-sm-9"> <div class="col-sm-9">
<select id="container" class="form-select" @bind="@_containertype" required> <select id="container" class="form-select" @bind="@_containertype" required>
@foreach (var container in _containers) @if (_containers != null)
{ {
<option value="@container.TypeName">@container.Name</option> foreach (var container in _containers)
{
<option value="@container.TypeName">@container.Name</option>
}
} }
</select> </select>
</div> </div>

View File

@ -13,7 +13,7 @@
{ {
_attributes.Add("target", _target); _attributes.Add("target", _target);
} }
if (!string.IsNullOrEmpty(childPage.ThemeType)) if (PageState.RenderMode == RenderModes.Static && PageState.Page.ThemeType != (string.IsNullOrEmpty(childPage.ThemeType) ? PageState.Site.DefaultThemeType : childPage.ThemeType))
{ {
_attributes.Add("data-enhance-nav", "false"); _attributes.Add("data-enhance-nav", "false");
} }
@ -50,7 +50,7 @@ else
{ {
_attributes.Add("target", _target); _attributes.Add("target", _target);
} }
if (!string.IsNullOrEmpty(childPage.ThemeType)) if (PageState.RenderMode == RenderModes.Static && PageState.Page.ThemeType != (string.IsNullOrEmpty(childPage.ThemeType) ? PageState.Site.DefaultThemeType : childPage.ThemeType))
{ {
_attributes.Add("data-enhance-nav", "false"); _attributes.Add("data-enhance-nav", "false");
} }

View File

@ -12,7 +12,7 @@
{ {
_attributes.Add("target", _target); _attributes.Add("target", _target);
} }
if (!string.IsNullOrEmpty(childPage.ThemeType)) if (PageState.RenderMode == RenderModes.Static && PageState.Page.ThemeType != (string.IsNullOrEmpty(childPage.ThemeType) ? PageState.Site.DefaultThemeType : childPage.ThemeType))
{ {
_attributes.Add("data-enhance-nav", "false"); _attributes.Add("data-enhance-nav", "false");
} }
@ -56,7 +56,7 @@ else
{ {
_attributes.Add("target", _target); _attributes.Add("target", _target);
} }
if (!string.IsNullOrEmpty(childPage.ThemeType)) if (PageState.RenderMode == RenderModes.Static && PageState.Page.ThemeType != (string.IsNullOrEmpty(childPage.ThemeType) ? PageState.Site.DefaultThemeType : childPage.ThemeType))
{ {
_attributes.Add("data-enhance-nav", "false"); _attributes.Add("data-enhance-nav", "false");
} }