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 5501f0a31..4deb1f207 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -72,12 +72,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))); } } @@ -150,8 +145,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); @@ -409,7 +404,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}> @@ -675,7 +670,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> ); } |