diff --git a/src/pb-tify.js b/src/pb-tify.js index 04ca349a..614850ed 100644 --- a/src/pb-tify.js +++ b/src/pb-tify.js @@ -59,6 +59,11 @@ export class PbTify extends pbMixin(LitElement) { _injectStylesheet(this.cssPath); + this._container = document.createElement('div'); + this._container.style.height = '100%'; + this._container.style.width = '100%'; + this.appendChild(this._container); + this.subscribeTo('pb-show-annotation', (ev) => { if (ev.detail) { this._initialPages = ev.detail.order ? Number(ev.detail.order) : Number.POSITIVE_INFINITY; @@ -81,11 +86,6 @@ export class PbTify extends pbMixin(LitElement) { super.firstUpdated(); waitOnce('pb-page-ready', () => { - this._container = document.createElement('div'); - this._container.style.height = '100%'; - this._container.style.width = '100%'; - this.appendChild(this._container); - this._initViewer(); }); }