mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[Editor] Edit an existing FreeText annotation in double-clicking on it (bug 1787298)
This commit is contained in:
parent
c33e6ceb03
commit
5c5f9af803
8 changed files with 86 additions and 14 deletions
|
@ -2518,7 +2518,7 @@ function webViewerPresentationMode() {
|
|||
PDFViewerApplication.requestPresentationMode();
|
||||
}
|
||||
function webViewerSwitchAnnotationEditorMode(evt) {
|
||||
PDFViewerApplication.pdfViewer.annotationEditorMode = evt.mode;
|
||||
PDFViewerApplication.pdfViewer.annotationEditorMode = evt;
|
||||
}
|
||||
function webViewerSwitchAnnotationEditorParams(evt) {
|
||||
PDFViewerApplication.pdfViewer.annotationEditorParams = evt;
|
||||
|
|
|
@ -175,7 +175,9 @@ class PDFPresentationMode {
|
|||
this.pdfViewer.currentScaleValue = "page-fit";
|
||||
|
||||
if (this.#args.annotationEditorMode !== null) {
|
||||
this.pdfViewer.annotationEditorMode = AnnotationEditorType.NONE;
|
||||
this.pdfViewer.annotationEditorMode = {
|
||||
mode: AnnotationEditorType.NONE,
|
||||
};
|
||||
}
|
||||
}, 0);
|
||||
|
||||
|
|
|
@ -2203,7 +2203,7 @@ class PDFViewer {
|
|||
/**
|
||||
* @param {number} mode - AnnotationEditor mode (None, FreeText, Ink, ...)
|
||||
*/
|
||||
set annotationEditorMode(mode) {
|
||||
set annotationEditorMode({ mode, editId = null }) {
|
||||
if (!this.#annotationEditorUIManager) {
|
||||
throw new Error(`The AnnotationEditor is not enabled.`);
|
||||
}
|
||||
|
@ -2222,7 +2222,7 @@ class PDFViewer {
|
|||
mode,
|
||||
});
|
||||
|
||||
this.#annotationEditorUIManager.updateMode(mode);
|
||||
this.#annotationEditorUIManager.updateMode(mode, editId);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line accessor-pairs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue