diff options
author | bobzel <zzzman@gmail.com> | 2021-02-10 22:32:29 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-02-10 22:32:29 -0500 |
commit | aed4a386bf57ba7b1b144bacd39f9f9ccabe0dfd (patch) | |
tree | 537ea7b01c98e5cdde362984292c4db3173e98c4 /src/client/views/nodes/PDFBox.tsx | |
parent | f240c85ff0adee914b43d9d169fa31260e03265d (diff) |
simplified focus'ing on documents. refactored scrollFocus code. changed focus in 2D to move doc into view but not center.
Diffstat (limited to 'src/client/views/nodes/PDFBox.tsx')
-rw-r--r-- | src/client/views/nodes/PDFBox.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index 496caedaa..4b926bb6f 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -22,6 +22,7 @@ import { FieldView, FieldViewProps } from './FieldView'; import { pageSchema } from "./ImageBox"; import "./PDFBox.scss"; import React = require("react"); +import { DocAfterFocusFunc } from './DocumentView'; type PdfDocument = makeInterface<[typeof documentSchema, typeof panZoomSchema, typeof pageSchema]>; const PdfDocument = makeInterface(documentSchema, panZoomSchema, pageSchema); @@ -79,7 +80,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent<FieldViewProps, PdfDocum } } - scrollFocus = (doc: Doc, smooth: boolean) => doc !== this.rootDoc && this._pdfViewer?.scrollFocus(doc, smooth); + scrollFocus = (doc: Doc, smooth: boolean, afterFocus?: DocAfterFocusFunc) => { this._pdfViewer?.scrollFocus(doc, smooth, afterFocus); } getAnchor = () => this.rootDoc; componentWillUnmount() { this._selectReactionDisposer?.(); } componentDidMount() { |