aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-09-19 20:50:30 -0400
committerbobzel <zzzman@gmail.com>2022-09-19 20:50:30 -0400
commit87096243391cf172c26190897c79321b3d42817c (patch)
tree1dc372bccbd923473d1e24643c710d5056210334 /src
parent54278e6ddea438b19aef2e6e3758c45b8605b3e3 (diff)
fixed searching in pdfs by updating to pdfjs's new findController api
Diffstat (limited to 'src')
-rw-r--r--src/client/views/pdf/PDFViewer.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index 5925c0392..5c10c7cef 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -325,13 +325,13 @@ export class PDFViewer extends React.Component<IViewerProps> {
query: searchString,
};
if (clear) {
- this._pdfViewer?.findController.executeCommand('reset', { query: '' });
+ this._pdfViewer?.eventBus.dispatch('reset', {});
} else if (!searchString) {
bwd ? this.prevAnnotation() : this.nextAnnotation();
} else if (this._pdfViewer?.pageViewsReady) {
- this._pdfViewer.findController.executeCommand('findagain', findOpts);
+ this._pdfViewer?.eventBus.dispatch('find', { ...findOpts, type: 'again' });
} else if (this._mainCont.current) {
- const executeFind = () => this._pdfViewer.findController.executeCommand('find', findOpts);
+ const executeFind = () => this._pdfViewer?.eventBus.dispatch('find', findOpts);
this._mainCont.current.addEventListener('pagesloaded', executeFind);
this._mainCont.current.addEventListener('pagerendered', executeFind);
}