Added STRG+S support for editor and better saving

This commit is contained in:
Marcel Baumgartner
2023-06-20 20:37:57 +02:00
parent cd41db510e
commit 52d00baf2b
6 changed files with 104 additions and 5 deletions

View File

@@ -21,6 +21,7 @@
@inject SmartTranslateService SmartTranslateService
@inject IpBanService IpBanService
@inject DynamicBackgroundService DynamicBackgroundService
@inject KeyListenerService KeyListenerService
@{
var uri = new Uri(NavigationManager.Uri);
@@ -207,10 +208,14 @@
UserProcessed = true;
await InvokeAsync(StateHasChanged);
await JsRuntime.InvokeVoidAsync("document.body.removeAttribute", "data-kt-app-reset-transition");
await JsRuntime.InvokeVoidAsync("document.body.removeAttribute", "data-kt-app-page-loading");
await JsRuntime.InvokeVoidAsync("KTMenu.createInstances");
await JsRuntime.InvokeVoidAsync("KTDrawer.createInstances");
try
{
await JsRuntime.InvokeVoidAsync("document.body.removeAttribute", "data-kt-app-reset-transition");
await JsRuntime.InvokeVoidAsync("document.body.removeAttribute", "data-kt-app-page-loading");
await JsRuntime.InvokeVoidAsync("KTMenu.createInstances");
await JsRuntime.InvokeVoidAsync("KTDrawer.createInstances");
}
catch (Exception){ /* ignore errors to make sure that the session call is executed */ }
await SessionService.Register();
@@ -236,6 +241,8 @@
});
}
await KeyListenerService.Initialize();
RunDelayedMenu(0);
RunDelayedMenu(1);
RunDelayedMenu(3);
@@ -252,6 +259,8 @@
{
SessionService.Close();
await KeyListenerService.DisposeAsync();
if (User != null)
{
await Event.Off($"supportChat.{User.Id}.message", this);