Add "Cancel" button and navigation to sender page
Added the `NavigationManager` service injection to the `EnvelopeSenderEditorPage.razor` file to enable navigation. Introduced a "Cancel" button in the toolbar, styled with `pdf-toolbar__btn pdf-toolbar__btn--reset`, which triggers the `Cancel` method on click. The `Cancel` method navigates the user to the `/sender` route, improving the user experience by providing a clear way to cancel the current operation.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
@using EnvelopeGenerator.Server.Services
|
||||
@using Microsoft.AspNetCore.Components.Forms
|
||||
@inject IJSRuntime JSRuntime
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject AppVersionService AppVersion
|
||||
@inject ILogger<EnvelopeSenderEditorPage> Logger
|
||||
@inject EnvelopeReceiverPageDataService ReceiverPageDataService
|
||||
@@ -98,6 +99,12 @@
|
||||
@* Right: Buttons *@
|
||||
<div style="display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0;">
|
||||
|
||||
<button class="pdf-toolbar__btn pdf-toolbar__btn--reset"
|
||||
@onclick="Cancel"
|
||||
title="Abbrechen">
|
||||
Abbrechen
|
||||
</button>
|
||||
|
||||
@* PDF Upload *@
|
||||
<label class="pdf-toolbar__btn"
|
||||
title="PDF hochladen"
|
||||
@@ -424,6 +431,8 @@
|
||||
|
||||
void RemoveField(SignatureFieldDraft field) => _signatureFields.Remove(field);
|
||||
|
||||
void Cancel() => NavigationManager.NavigateTo("/sender");
|
||||
|
||||
// ── Overlay click → add signature field ──
|
||||
async Task OnOverlayClickAsync(MouseEventArgs e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user