aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Doc.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-06-29 14:59:29 -0400
committerbobzel <zzzman@gmail.com>2023-06-29 14:59:29 -0400
commitc99238c8b1e027099b2cd3f4b31b4c0b06d488d0 (patch)
tree15a2853d6799f6c208a6cb234ea95e8d5740decf /src/fields/Doc.ts
parente0dcbdbb9a2eaf0bd39ccdaa73e23506ea93984a (diff)
made recording annotation undoable. fixed doc filters for dates, change filter to use :: instead of :
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r--src/fields/Doc.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index c9f7e4114..f13dab68c 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -1430,6 +1430,8 @@ export namespace Doc {
}
}
+ export const FilterSep = '::';
+
// 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
@@ -1439,7 +1441,7 @@ export namespace Doc {
const childFilters = StrListCast(container[filterField]);
runInAction(() => {
for (let i = 0; i < childFilters.length; i++) {
- const fields = childFilters[i].split(':'); // split key:value:modifier
+ const fields = childFilters[i].split(FilterSep); // split key:value:modifier
if (fields[0] === key && (fields[1] === value || modifiers === 'match' || (fields[2] === 'match' && modifiers === 'remove'))) {
if (fields[2] === modifiers && modifiers && fields[1] === value) {
if (toggle) modifiers = 'remove';
@@ -1454,7 +1456,7 @@ export namespace Doc {
container[filterField] = undefined;
} else if (modifiers !== 'remove') {
!append && (childFilters.length = 0);
- childFilters.push(key + ':' + value + ':' + modifiers);
+ childFilters.push(key + FilterSep + value + FilterSep + modifiers);
container[filterField] = new List<string>(childFilters);
}
});