aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/PDFViewer.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-02-28 01:06:27 -0500
committerbobzel <zzzman@gmail.com>2021-02-28 01:06:27 -0500
commit7902b1021b89e45bd595e4a9588db11dccbf9831 (patch)
treec7b4ef671aedf7a8144131e3d04995d998f94caf /src/client/views/pdf/PDFViewer.tsx
parent3837b3746c771960e8a0f7b00648f739495ca92d (diff)
a bunch of changes to simplify how autoHeight works. extended to work for pdfs and stacking views. still some bugs.
Diffstat (limited to 'src/client/views/pdf/PDFViewer.tsx')
-rw-r--r--src/client/views/pdf/PDFViewer.tsx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index ca6dc87ae..720d2d92e 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -123,6 +123,12 @@ export class PDFViewer extends ViewBoxAnnotatableComponent<IViewerProps, PdfDocu
this.props.startupLive && this.setupPdfJsViewer();
this._mainCont.current?.addEventListener("scroll", e => (e.target as any).scrollLeft = 0);
+ this._disposers.autoHeight = reaction(() => this.layoutDoc._autoHeight,
+ () => {
+ this.layoutDoc._nativeHeight = NumCast(this.props.Document[this.fieldKey + "-nativeHeight"]);
+ this.props.setHeight(NumCast(this.props.Document[this.fieldKey + "-nativeHeight"]) * (this.props.scaling?.() || 1));
+ });
+
this._disposers.searchMatch = reaction(() => Doc.IsSearchMatch(this.rootDoc),
m => {
if (m) (this._lastSearch = true) && this.search(Doc.SearchQuery(), m.searchMatch > 0);