From b3aa238043d01cbc58293b45867706fa9b36cefe Mon Sep 17 00:00:00 2001 From: "A.J. Shulman" Date: Mon, 12 May 2025 15:46:30 -0400 Subject: workign better --- src/client/views/nodes/PDFBox.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/client/views/nodes/PDFBox.tsx') diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index 55e6d5596..4ecbd65b6 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -53,6 +53,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent() { private _sidebarRef = React.createRef(); @observable private _searching: boolean = false; + @observable private _fuzzySearchEnabled: boolean = true; @observable private _pdf: Opt = undefined; @observable private _pageControls = false; @@ -272,6 +273,14 @@ export class PDFBox extends ViewBoxAnnotatableComponent() { !this.Document._layout_fitWidth && (this.Document._height = NumCast(this.Document._width) * (p.height / p.width)); }; + @action + toggleFuzzySearch = () => { + this._fuzzySearchEnabled = !this._fuzzySearchEnabled; + this._pdfViewer?.toggleFuzzySearch(); + // Clear existing search results when switching modes + this.search('', false, true); + }; + override search = action((searchString: string, bwd?: boolean, clear: boolean = false) => { if (!this._searching && !clear) { this._searching = true; @@ -412,6 +421,9 @@ export class PDFBox extends ViewBoxAnnotatableComponent() { + -- cgit v1.2.3-70-g09d2