Skip to content

Commit 427de38

Browse files
committed
Fix openSource, new check for pdfApp and update config with the new signature elements
1 parent 21b1cd7 commit 427de38

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

packages/vue/src/components/VuePDFjs.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ async function initDocument(document: PDFDocumentProxy | null) {
149149
}
150150
151151
async function openSource(source: PDFSource | PDFSourceWithOptions | PDFDocumentProxy) {
152-
// isLoading is now managed by the watcher
152+
153+
if (!pdfApp.value) {
154+
return;
155+
}
156+
153157
try {
154158
if (source !== undefined && source !== null) {
155159
if (source instanceof PDFDocumentProxy) {

packages/vue/src/scripts/PDFViewerApplicationConfig.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export default (rootElement: ShadowRoot | Document) => {
3535
editorStampParamsToolbar: getElement(
3636
"editorStampParamsToolbar"
3737
),
38+
editorSignatureButton: getElement("editorSignatureButton"),
39+
editorSignatureParamsToolbar: getElement("editorSignatureParamsToolbar"),
3840
download: getElement("downloadButton"),
3941
},
4042
secondaryToolbar: {
@@ -174,13 +176,44 @@ export default (rootElement: ShadowRoot | Document) => {
174176
),
175177
closeButton: getElement("altTextSettingsCloseButton"),
176178
},
179+
addSignatureDialog: {
180+
dialog: getElement("addSignatureDialog"),
181+
panels: getElement("addSignatureActionContainer"),
182+
typeButton: getElement("addSignatureTypeButton"),
183+
typeInput: getElement("addSignatureTypeInput"),
184+
drawButton: getElement("addSignatureDrawButton"),
185+
drawSVG: getElement("addSignatureDraw"),
186+
drawPlaceholder: getElement("addSignatureDrawPlaceholder"),
187+
drawThickness: getElement("addSignatureDrawThickness"),
188+
imageButton: getElement("addSignatureImageButton"),
189+
imageSVG: getElement("addSignatureImage"),
190+
imagePlaceholder: getElement("addSignatureImagePlaceholder"),
191+
imagePicker: getElement("addSignatureFilePicker"),
192+
imagePickerLink: getElement("addSignatureImageBrowse"),
193+
description: getElement("addSignatureDescription"),
194+
clearButton: getElement("clearSignatureButton"),
195+
saveContainer: getElement("addSignatureSaveContainer"),
196+
saveCheckbox: getElement("addSignatureSaveCheckbox"),
197+
errorBar: getElement("addSignatureError"),
198+
errorCloseButton: getElement("addSignatureErrorCloseButton"),
199+
cancelButton: getElement("addSignatureCancelButton"),
200+
addButton: getElement("addSignatureAddButton"),
201+
},
202+
editSignatureDialog: {
203+
dialog: getElement("editSignatureDescriptionDialog"),
204+
description: getElement("editSignatureDescription"),
205+
editSignatureView: getElement("editSignatureView"),
206+
cancelButton: getElement("editSignatureCancelButton"),
207+
updateButton: getElement("editSignatureUpdateButton"),
208+
},
177209
annotationEditorParams: {
178210
editorFreeTextFontSize: getElement("editorFreeTextFontSize"),
179211
editorFreeTextColor: getElement("editorFreeTextColor"),
180212
editorInkColor: getElement("editorInkColor"),
181213
editorInkThickness: getElement("editorInkThickness"),
182214
editorInkOpacity: getElement("editorInkOpacity"),
183215
editorStampAddImage: getElement("editorStampAddImage"),
216+
editorSignatureAddSignature: getElement("editorSignatureAddSignature"),
184217
editorFreeHighlightThickness: getElement(
185218
"editorFreeHighlightThickness"
186219
),

0 commit comments

Comments
 (0)