Commit d70da1e3 authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

Remove <hypothesis-banner> element on destroy

On `destroy` the PDF integration clean up the `<hypothesis-banner>`
element, if any.
parent 0330166c
...@@ -138,6 +138,7 @@ export class PDFIntegration { ...@@ -138,6 +138,7 @@ export class PDFIntegration {
this._listeners.removeAll(); this._listeners.removeAll();
this.pdfViewer.viewer.classList.remove('has-transparent-text-layer'); this.pdfViewer.viewer.classList.remove('has-transparent-text-layer');
this.observer.disconnect(); this.observer.disconnect();
this._warningBanner?.remove();
this._destroyed = true; this._destroyed = true;
} }
......
...@@ -104,7 +104,6 @@ describe('annotator/integrations/pdf', () => { ...@@ -104,7 +104,6 @@ describe('annotator/integrations/pdf', () => {
pdfIntegration?.destroy(); pdfIntegration?.destroy();
delete window.PDFViewerApplication; delete window.PDFViewerApplication;
outerContainer.remove(); outerContainer.remove();
document.querySelector('hypothesis-banner')?.remove(); // <hypothesis-banner> elements are created outside the outerContainer
$imports.$restore(); $imports.$restore();
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment