From e20a8916483734bb06d08409b6bc804c2391a289 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sat, 13 Mar 2021 12:38:12 -0500 Subject: fixed pdfs to show filtered annotations when a link follows to them by removing docFilters. --- src/client/views/nodes/PDFBox.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/client/views') diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index e1ac8f16d..4e4db323c 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -28,6 +28,8 @@ import { FormattedTextBox } from './formattedText/FormattedTextBox'; import { pageSchema } from "./ImageBox"; import "./PDFBox.scss"; import React = require("react"); +import { DocFocusOptions } from './DocumentView'; +import { List } from '../../../fields/List'; type PdfDocument = makeInterface<[typeof documentSchema, typeof panZoomSchema, typeof pageSchema]>; const PdfDocument = makeInterface(documentSchema, panZoomSchema, pageSchema); @@ -87,6 +89,12 @@ export class PDFBox extends ViewBoxAnnotatableComponent; scrollFocus = (doc: Doc, smooth: boolean) => { + if (DocListCast(this.rootDoc[this.sidebarKey()]).includes(doc)) { + if (this.layoutDoc["_" + this.sidebarKey() + "-docFilters"]) { + this.layoutDoc["_" + this.sidebarKey() + "-docFilters"] = new List(); + return 1; + } + } this.initialScrollTarget = doc; return this._pdfViewer?.scrollFocus(doc, smooth); } @@ -298,7 +306,6 @@ export class PDFBox extends ViewBoxAnnotatableComponent ; } - isChildActive = (outsideReaction?: boolean) => this._isChildActive; @computed get renderPdfView() { TraceMobx(); -- cgit v1.2.3-70-g09d2