aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/PDFViewer.tsx
diff options
context:
space:
mode:
authorAndy Rickert <andrew_rickert@brown.edu>2020-07-03 13:37:12 -0400
committerAndy Rickert <andrew_rickert@brown.edu>2020-07-03 13:37:12 -0400
commitb058ca45c5d8f3168fdb3a9e8733152765afdb0b (patch)
tree5d66db927370f2d7cd6a016e5bc77f202e37e65b /src/client/views/pdf/PDFViewer.tsx
parent552e340758ae187459786d742c5e9d2487446f1b (diff)
parent435995b1fb8ef52d2f76b89ca161e4372fb79cfd (diff)
merge w search_doc
Diffstat (limited to 'src/client/views/pdf/PDFViewer.tsx')
-rw-r--r--src/client/views/pdf/PDFViewer.tsx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index 4fdc82388..98f64edec 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -106,6 +106,7 @@ export class PDFViewer extends ViewBoxAnnotatableComponent<IViewerProps, PdfDocu
private _scrollTopReactionDisposer?: IReactionDisposer;
private _filterReactionDisposer?: IReactionDisposer;
private _searchReactionDisposer?: IReactionDisposer;
+ private _searchReactionDisposer2?: IReactionDisposer;
private _viewer: React.RefObject<HTMLDivElement> = React.createRef();
private _mainCont: React.RefObject<HTMLDivElement> = React.createRef();
private _selectionText: string = "";
@@ -328,7 +329,10 @@ export class PDFViewer extends ViewBoxAnnotatableComponent<IViewerProps, PdfDocu
}
@action
prevAnnotation = () => {
+ console.log(this.Index);
this.Index = Math.max(this.Index - 1, 0);
+ console.log(this.Index);
+ console.log(this.allAnnotations);
this.scrollToAnnotation(this.allAnnotations.sort((a, b) => NumCast(a.y) - NumCast(b.y))[this.Index]);
}
@@ -336,6 +340,9 @@ export class PDFViewer extends ViewBoxAnnotatableComponent<IViewerProps, PdfDocu
nextAnnotation = () => {
this.Index = Math.min(this.Index + 1, this.allAnnotations.length - 1);
this.scrollToAnnotation(this.allAnnotations.sort((a, b) => NumCast(a.y) - NumCast(b.y))[this.Index]);
+ this.Document.searchIndex = this.Index;
+ this.Document.length = this.allAnnotations.length;
+
}
@action
@@ -403,6 +410,8 @@ export class PDFViewer extends ViewBoxAnnotatableComponent<IViewerProps, PdfDocu
phraseSearch: true,
query: searchString
});
+ this.Document.searchIndex = this.Index;
+ this.Document.length = this.allAnnotations.length;
}
else if (this._mainCont.current) {
const executeFind = () => {
@@ -416,7 +425,10 @@ export class PDFViewer extends ViewBoxAnnotatableComponent<IViewerProps, PdfDocu
};
this._mainCont.current.addEventListener("pagesloaded", executeFind);
this._mainCont.current.addEventListener("pagerendered", executeFind);
+ this.Document.searchIndex = this.Index;
+ this.Document.length = this.allAnnotations.length;
}
+
}
@action