fix: implement clone method for DrawingOptions and remove signature mode init
The clone method in DrawingOptions was previously unimplemented, now it properly creates a copy. Also removed unnecessary signature mode initialization in sign-pdf.ts as it's handled elsewhere.
This commit is contained in:
@@ -21663,7 +21663,9 @@ class DrawingOptions {
|
||||
this.updateProperties(options);
|
||||
}
|
||||
clone() {
|
||||
unreachable("Not implemented");
|
||||
const copy = new this.constructor();
|
||||
copy.updateAll(this);
|
||||
return copy;
|
||||
}
|
||||
}
|
||||
class DrawingEditor extends AnnotationEditor {
|
||||
|
||||
@@ -69,15 +69,6 @@ export async function setupSignTool() {
|
||||
if (editorStampButton) {
|
||||
editorStampButton.disabled = false;
|
||||
}
|
||||
|
||||
// Ensure annotation editor is fully enabled; start in Signature mode
|
||||
const pdfViewer = app.pdfViewer;
|
||||
const AnnotationEditorType = viewerWindow.pdfjsLib?.AnnotationEditorType;
|
||||
if (pdfViewer && AnnotationEditorType) {
|
||||
pdfViewer.annotationEditorMode = {
|
||||
mode: AnnotationEditorType.SIGNATURE,
|
||||
};
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Could not initialize base PDF.js viewer for signing:', e);
|
||||
|
||||
Reference in New Issue
Block a user