diff options
Diffstat (limited to 'src/client/views/nodes/PDFBox.tsx')
-rw-r--r-- | src/client/views/nodes/PDFBox.tsx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index 34211fa07..9fb1b07c4 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -73,12 +73,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { !this.Document._layout_fitWidth && (this.Document._height = NumCast(this.Document._width) * (nh / nw)); if (this.pdfUrl) { this._pdf = PDFBox.pdfcache.get(this.pdfUrl.url.href); - !this._pdf && - PDFBox.pdfpromise.get(this.pdfUrl.url.href)?.then( - action(pdf => { - this._pdf = pdf; - }) - ); + !this._pdf && PDFBox.pdfpromise.get(this.pdfUrl.url.href)?.then(action(pdf => (this._pdf = pdf))); } } @@ -151,8 +146,8 @@ export class PDFBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { this.addDocument(region); const newDiv = docViewContent.cloneNode(true) as HTMLDivElement; - newDiv.style.width = NumCast(this.layoutDoc._width).toString(); - newDiv.style.height = NumCast(this.layoutDoc._height).toString(); + newDiv.style.width = NumCast(this.layoutDoc._width).toString() + 'px'; + newDiv.style.height = NumCast(this.layoutDoc._height).toString() + 'px'; this.replaceCanvases(docViewContent, newDiv); const htmlString = this._pdfViewer?._mainCont.current && new XMLSerializer().serializeToString(newDiv); @@ -418,7 +413,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { this.layoutDoc._show_sidebar = nativeWidth !== this.layoutDoc._nativeWidth; } }); - settingsPanel() { + @computed get settingsPanel() { const pageBtns = ( <> <button type="button" className="pdfBox-backBtn" key="back" title="Page Back" onPointerDown={e => e.stopPropagation()} onClick={this.backPage}> @@ -687,7 +682,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { <div className="pdfBox-sidebarContainer" style={{ width: `calc(100 * ${this.sidebarWidth() / this._props.PanelWidth()}%` }}> {this.sidebarCollection} </div> - {this.settingsPanel()} + {this.settingsPanel} </div> ); } |