[Editor] Edit an existing FreeText annotation in double-clicking on it (bug 1787298)

This commit is contained in:
Calixte Denizet 2023-07-07 15:51:48 +02:00
parent c33e6ceb03
commit 5c5f9af803
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;
}
}