Add configurable mouse wheel zoom to PDF editor
Introduced the `EnableWheelZoom` parameter in `SenderPdfImageEditor.razor` to allow toggling mouse wheel zoom functionality. Updated the JavaScript interop call to pass this parameter to the `ensureZoomOverride` function in `envelope-editor.js`. Modified the `OnEditorWheelAsync` method to respect the `EnableWheelZoom` setting, preventing zoom actions when disabled. Updated `CreateEnvelopeWizardPopup.razor` to explicitly disable wheel zoom for its instance of the PDF editor. Enhanced `ensureZoomOverride` in `envelope-editor.js` to handle the `enableWheelZoom` parameter, attaching or updating the `zoomOverrideEnableWheelZoom` dataset attribute to control zoom behavior dynamically.
This commit is contained in:
@@ -163,6 +163,9 @@
|
||||
[Parameter]
|
||||
public bool ShowToolbar { get; set; } = true;
|
||||
|
||||
[Parameter]
|
||||
public bool EnableWheelZoom { get; set; } = true;
|
||||
|
||||
[Parameter]
|
||||
public IReadOnlyCollection<int> HiddenFieldIndexes { get; set; } = Array.Empty<int>();
|
||||
|
||||
@@ -304,7 +307,8 @@
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync(
|
||||
"envelopeEditor.ensureZoomOverride",
|
||||
"sender-editor-pdf-viewer");
|
||||
"sender-editor-pdf-viewer",
|
||||
EnableWheelZoom);
|
||||
|
||||
_zoomOverrideInitialized = true;
|
||||
}
|
||||
@@ -470,6 +474,9 @@
|
||||
|
||||
private async Task OnEditorWheelAsync(WheelEventArgs args)
|
||||
{
|
||||
if (!EnableWheelZoom)
|
||||
return;
|
||||
|
||||
if (args.CtrlKey)
|
||||
{
|
||||
if (args.DeltaY < 0)
|
||||
|
||||
@@ -410,7 +410,8 @@
|
||||
Fields="Array.Empty<SenderPdfFieldOverlay>()"
|
||||
SignatureOverlays="Array.Empty<SenderPdfSignatureOverlay>()"
|
||||
ShowFieldRemoveButton="false"
|
||||
ShowToolbar="false" />
|
||||
ShowToolbar="false"
|
||||
EnableWheelZoom="false" />
|
||||
</div>
|
||||
}
|
||||
</aside>
|
||||
|
||||
Reference in New Issue
Block a user