Merge pull request #17075 from calixteman/issue17069_followup

Add a HTML containter for locked FreeText annotations in order to be able to display a popup (follow-up of #17070)
This commit is contained in:
calixteman 2023-10-05 15:17:58 +02:00 committed by GitHub
commit a60f90ae94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -3724,6 +3724,8 @@ class FreeTextAnnotation extends MarkupAnnotation {
// But if it has the noHTML flag, it means that we don't want to be able // But if it has the noHTML flag, it means that we don't want to be able
// to modify it so we can just draw it on the main canvas. // to modify it so we can just draw it on the main canvas.
this.data.hasOwnCanvas = !this.data.noHTML; this.data.hasOwnCanvas = !this.data.noHTML;
// We want to be able to add mouse listeners to the annotation.
this.data.noHTML = false;
const { evaluatorOptions, xref } = params; const { evaluatorOptions, xref } = params;
this.data.annotationType = AnnotationType.FREETEXT; this.data.annotationType = AnnotationType.FREETEXT;

View File

@ -671,7 +671,14 @@ class AnnotationElement {
} }
} }
get _isEditable() {
return false;
}
_editOnDoubleClick() { _editOnDoubleClick() {
if (!this._isEditable) {
return;
}
const { const {
annotationEditorType: mode, annotationEditorType: mode,
data: { id: editId }, data: { id: editId },
@ -2347,6 +2354,10 @@ class FreeTextAnnotationElement extends AnnotationElement {
return this.container; return this.container;
} }
get _isEditable() {
return this.data.hasOwnCanvas;
}
} }
class LineAnnotationElement extends AnnotationElement { class LineAnnotationElement extends AnnotationElement {