aboutsummaryrefslogtreecommitdiff
path: root/src/fields
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-03-13 11:45:52 -0500
committerbobzel <zzzman@gmail.com>2021-03-13 11:45:52 -0500
commit280c24f1216a532e9f2157e6db0bf8c8030a16f3 (patch)
treeeb2b648cbd0a099c31f93c9cd426c0500703722a /src/fields
parentdf0c30a1f8c1a507be7582a9c97dc5546ae719c8 (diff)
fixed pdf boxes to handle marquee annotation scaling properly. allowed for docFilters to be specific to pdf sidebar. fixed issue with viewTransition remaining set after following link to doc that was in collection but needs to be created.
Diffstat (limited to 'src/fields')
-rw-r--r--src/fields/Doc.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index e64195b63..e26d771d3 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -1063,9 +1063,10 @@ 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
- export function setDocFilter(target: Opt<Doc>, key: string, value: any, modifiers: "remove" | "match" | "check" | "x", toggle?: boolean) {
+ export function setDocFilter(target: Opt<Doc>, key: string, value: any, modifiers: "remove" | "match" | "check" | "x", toggle?: boolean, fieldSuffix?:string) {
const container = target ?? CollectionDockingView.Instance.props.Document;
- const docFilters = Cast(container._docFilters, listSpec("string"), []);
+ const filterField = "_"+(fieldSuffix ? fieldSuffix+"-":"")+"docFilters";
+ const docFilters = Cast(container[filterField], listSpec("string"), []);
runInAction(() => {
for (let i = 0; i < docFilters.length; i++) {
const fields = docFilters[i].split(":"); // split key:value:modifier
@@ -1075,15 +1076,15 @@ export namespace Doc {
else return;
}
docFilters.splice(i, 1);
- container._docFilters = new List<string>(docFilters);
+ container[filterField] = new List<string>(docFilters);
break;
}
}
if (!docFilters.length && modifiers === "match" && value === undefined) {
- container._docFilters = undefined;
+ container[filterField] = undefined;
} else if (modifiers !== "remove") {
docFilters.push(key + ":" + value + ":" + modifiers);
- container._docFilters = new List<string>(docFilters);
+ container[filterField] = new List<string>(docFilters);
}
});
}