always render page-script elements in body

This commit is contained in:
sbwalker 2024-12-18 11:56:03 -05:00
parent 03f856025e
commit 3a1244bddc

View File

@ -56,10 +56,6 @@
<Head RenderMode="@_renderMode" Runtime="@_runtime" @rendermode="InteractiveRenderMode.GetInteractiveRenderMode(_runtime, _prerender)" /> <Head RenderMode="@_renderMode" Runtime="@_runtime" @rendermode="InteractiveRenderMode.GetInteractiveRenderMode(_runtime, _prerender)" />
} }
@((MarkupString)_headResources) @((MarkupString)_headResources)
@if (_renderMode == RenderModes.Static)
{
<page-script src="./js/reload.js"></page-script>
}
</head> </head>
<body> <body>
@if (string.IsNullOrEmpty(_message)) @if (string.IsNullOrEmpty(_message))
@ -80,6 +76,10 @@
@((MarkupString)_scripts) @((MarkupString)_scripts)
@((MarkupString)_bodyResources) @((MarkupString)_bodyResources)
@if (_renderMode == RenderModes.Static)
{
<page-script src="./js/reload.js"></page-script>
}
} }
else else
{ {
@ -533,7 +533,7 @@
private void AddScript(Resource resource, Alias alias) private void AddScript(Resource resource, Alias alias)
{ {
var script = CreateScript(resource, alias); var script = CreateScript(resource, alias);
if (resource.Location == Shared.ResourceLocation.Head) if (resource.Location == Shared.ResourceLocation.Head && !resource.Reload)
{ {
if (!_headResources.Contains(script)) if (!_headResources.Contains(script))
{ {