Adds views script handling during global AJAX navigation

This commit is contained in:
BinaryAlley committed 2024-11-17 11:46:48 +02:00
1 parent 1eeb6661ca
commit a840364483
8 files changed
+183 -34

No files matched your search

@@ -7,6 +7,11 @@
@inject IUrlService _urlService
@{
// generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler
var scriptId = ScriptIdentifierHelper.GenerateScriptId();
}
@model ChangePasswordRequestModel
<div class="enlightenment-panel shadow-effect p-2 mx-auto panel w-50 mb-10" style="min-width: 320px; margin-top: 1rem;">
@@ -59,7 +64,7 @@
</div>
</div>
@section Scripts {
<script type="text/javascript" defer>
<script type="text/javascript" data-form="@scriptId" defer>
document.getElementById('change-password-form').addEventListener('keypress', async (event) => {
if (event.key === 'Enter') {
event.preventDefault();