Merge pull request #4926 from sbwalker/dev

always render page-script elements in body
This commit is contained in:
Shaun Walker 2024-12-18 11:56:18 -05:00 committed by GitHub
commit 2b4b01bf6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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))
{ {