mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +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
|
@ -601,6 +601,20 @@ class AnnotationElement {
|
|||
triggers.classList.add("highlightArea");
|
||||
}
|
||||
}
|
||||
|
||||
_editOnDoubleClick() {
|
||||
const {
|
||||
annotationEditorType: mode,
|
||||
data: { id: editId },
|
||||
} = this;
|
||||
this.container.addEventListener("dblclick", () => {
|
||||
this.linkService.eventBus?.dispatch("switchannotationeditormode", {
|
||||
source: this,
|
||||
mode,
|
||||
editId,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class LinkAnnotationElement extends AnnotationElement {
|
||||
|
@ -2217,6 +2231,9 @@ class FreeTextAnnotationElement extends AnnotationElement {
|
|||
if (!this.data.popupRef) {
|
||||
this._createPopup();
|
||||
}
|
||||
|
||||
this._editOnDoubleClick();
|
||||
|
||||
return this.container;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue