Add reset button to PDF toolbar for signature reset
Added a reset button to the PDF toolbar in `EnvelopeViewer.razor` to allow users to reset all signatures and state. The button is conditionally displayed when there are signed signatures (`_signedSignatures > 0`). Implemented the `RestartSigning` method to reload the page and reset all signatures by navigating to the current URI with `forceLoad: true`. Introduced new styles in `envelope-viewer.css` for the reset button, including hover effects, background gradients, border colors, and transitions for a polished user experience. Updated the reset button to include an SVG icon with hover effects for better visual feedback and consistency with the application's design.
This commit is contained in:
@@ -256,6 +256,22 @@
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="pdf-toolbar__divider"></div>
|
||||
|
||||
@* Reset button - only show when signatures are signed *@
|
||||
@if (_signedSignatures > 0) {
|
||||
<div class="pdf-toolbar__section">
|
||||
<button class="pdf-toolbar__btn pdf-toolbar__btn--reset"
|
||||
@onclick="RestartSigning"
|
||||
title="Unterschriften zurücksetzen">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z"/>
|
||||
<path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@@ -777,6 +793,11 @@ const int MaxThumbnailWidth = 400;
|
||||
await JSRuntime.InvokeVoidAsync("pdfViewer.goToNextSignature", _dotNetRef);
|
||||
}
|
||||
|
||||
void RestartSigning() {
|
||||
// Force page reload to reset all signatures and state
|
||||
Navigation.NavigateTo(Navigation.Uri, forceLoad: true);
|
||||
}
|
||||
|
||||
record SignatureNavState(int Total, int Signed, int Unsigned, int CurrentIndex, bool CanGoPrev, bool CanGoNext);
|
||||
|
||||
// Signature popup methods
|
||||
|
||||
Reference in New Issue
Block a user