Merge pull request #16659 from calixteman/edit_freetexts

[Editor] Edit an existing FreeText annotation in double-clicking on it (bug 1787298)
This commit is contained in:
calixteman 2023-07-07 22:02:11 +02:00 committed by GitHub
commit 52c98eb751
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 86 additions and 14 deletions

View file

@ -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;
}
}