From c60be390a83520c0be1a5de2c4748b60aa15fd45 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 7 Apr 2021 11:44:05 -0400 Subject: restricted scope of filter values/keys to documents in scope of filter --- src/client/views/nodes/FilterBox.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/FilterBox.tsx b/src/client/views/nodes/FilterBox.tsx index 3e735404f..d7f51c57b 100644 --- a/src/client/views/nodes/FilterBox.tsx +++ b/src/client/views/nodes/FilterBox.tsx @@ -12,7 +12,6 @@ import { Cast, StrCast } from "../../../fields/Types"; import { emptyFunction, returnEmptyDoclist, returnEmptyFilter, returnFalse, returnTrue } from "../../../Utils"; import { Docs } from "../../documents/Documents"; import { DocumentType } from "../../documents/DocumentTypes"; -import { CollectionDockingView } from "../collections/CollectionDockingView"; import { CollectionTreeView } from "../collections/CollectionTreeView"; import { ViewBoxBaseComponent } from "../DocComponent"; import { SearchBox } from "../search/SearchBox"; @@ -91,7 +90,7 @@ export class FilterBox extends ViewBoxBaseComponent DocListCastAsync(CollectionDockingView.Instance.props.Document.data), + reaction(() => DocListCastAsync(this.layoutDoc.data), async (activeTabsAsync) => { const activeTabs = await activeTabsAsync; activeTabs && (await SearchBox.foreachRecursiveDocAsync(activeTabs, emptyFunction)); @@ -527,7 +526,7 @@ Scripting.addGlobal(function determineCheckedState(layoutDoc: Doc, facetHeader: return undefined; }); Scripting.addGlobal(function readFacetData(layoutDoc: Doc, facetHeader: string) { - const allCollectionDocs = DocListCast(CollectionDockingView.Instance?.props.Document.allDocuments); + const allCollectionDocs = DocListCast(layoutDoc.allDocuments); const set = new Set(); if (facetHeader === "tags") allCollectionDocs.forEach(child => Field.toString(child[facetHeader] as Field).split(":").forEach(key => set.add(key))); else allCollectionDocs.forEach(child => set.add(Field.toString(child[facetHeader] as Field))); -- cgit v1.2.3-70-g09d2