Merge pull request #15800 from Snuffleupagus/AnnotationEditorLayerBuilder-destroy
[AnnotationEditorLayerBuilder] Inline the `destroy` code in the `cancel` method
This commit is contained in:
commit
879a7432b5
@ -98,7 +98,13 @@ class AnnotationEditorLayerBuilder {
|
||||
|
||||
cancel() {
|
||||
this._cancelled = true;
|
||||
this.destroy();
|
||||
|
||||
if (!this.div) {
|
||||
return;
|
||||
}
|
||||
this.pageDiv = null;
|
||||
this.annotationEditorLayer.destroy();
|
||||
this.div.remove();
|
||||
}
|
||||
|
||||
hide() {
|
||||
@ -114,15 +120,6 @@ class AnnotationEditorLayerBuilder {
|
||||
}
|
||||
this.div.hidden = false;
|
||||
}
|
||||
|
||||
destroy() {
|
||||
if (!this.div) {
|
||||
return;
|
||||
}
|
||||
this.pageDiv = null;
|
||||
this.annotationEditorLayer.destroy();
|
||||
this.div.remove();
|
||||
}
|
||||
}
|
||||
|
||||
export { AnnotationEditorLayerBuilder };
|
||||
|
@ -431,18 +431,14 @@ class PDFPageView {
|
||||
// so they are not displayed on the already resized page.
|
||||
this.annotationLayer.hide();
|
||||
}
|
||||
|
||||
if (annotationEditorLayerNode) {
|
||||
this.annotationEditorLayer.hide();
|
||||
} else {
|
||||
this.annotationEditorLayer?.destroy();
|
||||
}
|
||||
if (xfaLayerNode) {
|
||||
// Hide the XFA layer until all elements are resized
|
||||
// so they are not displayed on the already resized page.
|
||||
this.xfaLayer.hide();
|
||||
}
|
||||
|
||||
if (textLayerNode) {
|
||||
this.textLayer.hide();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user