aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Doc.ts
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2021-03-11 16:22:09 -0500
committerusodhi <61431818+usodhi@users.noreply.github.com>2021-03-11 16:22:09 -0500
commit1c6a3568005bb25541d45db4b53f1955ff3b0e39 (patch)
tree1396288e8d11fddd77bba66e65e73e78f4dde3d3 /src/fields/Doc.ts
parent55aeb2f80dd48e758fcf6b957233d4949c4b063e (diff)
adding and/or to filtering, added editableview, changed a bunch of things
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r--src/fields/Doc.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index 75d15c409..b0d77f0de 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -1049,7 +1049,7 @@ export namespace Doc {
doc.layoutKey = deiconify || "layout";
}
export function setDocFilterRange(target: Doc, key: string, range?: number[]) {
- const container = target ?? CollectionDockingView.Instance.props.Document;
+ const container = target ?? FilterBox._filterScope === "Current Collection" ? SelectionManager.Views()[0].Document || CollectionDockingView.Instance.props.Document : CollectionDockingView.Instance.props.Document;
const docRangeFilters = Cast(container._docRangeFilters, listSpec("string"), []);
for (let i = 0; i < docRangeFilters.length; i += 3) {
if (docRangeFilters[i] === key) {
@@ -1065,9 +1065,11 @@ export namespace Doc {
}
}
- // filters document in a container collection:
- // all documents with the specified value for the specified key are included/excluded
- // based on the modifiers :"check", "x", undefined
+ /**
+ * Filters document in a container collection:
+ * all documents with the specified value for the specified key are included/excluded
+ * based on the modifiers :"check", "x", undefined
+ */
export function setDocFilter(target: Opt<Doc>, key: string, value: any, modifiers?: "remove" | "match" | "check" | "x" | undefined) {
const container = target ?? FilterBox._filterScope === "Current Collection" ? SelectionManager.Views()[0].Document || CollectionDockingView.Instance.props.Document : CollectionDockingView.Instance.props.Document;
const docFilters = Cast(container._docFilters, listSpec("string"), []);