diff options
author | geireann <geireann.lindfield@gmail.com> | 2021-08-24 19:07:24 -0400 |
---|---|---|
committer | geireann <geireann.lindfield@gmail.com> | 2021-08-24 19:07:24 -0400 |
commit | 5e12fe1f5dfe73aeb5744d61ecbee02fbf14c59e (patch) | |
tree | f6e40215834974d3692bce12af09f7f461deb860 /src/fields/Doc.ts | |
parent | 0c5a95f37e91a07041699514155fd214f544a0de (diff) | |
parent | e221001a24e8615aa6113dd3f25b8c6e10c74999 (diff) |
Merge branch 'master' into menu_updates_geireann
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index e4087cf43..f6efefdf9 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -25,6 +25,7 @@ import { deleteProperty, GetEffectiveAcl, getField, getter, inheritParentAcls, m import JSZip = require("jszip"); import { CurrentUserUtils } from "../client/util/CurrentUserUtils"; import { IconProp } from "@fortawesome/fontawesome-svg-core"; +import Color = require("color"); export namespace Field { export function toKeyValueString(doc: Doc, key: string): string { @@ -1087,6 +1088,10 @@ export namespace Doc { } export function matchFieldValue(doc: Doc, key: string, value: any): boolean { + if (value === "isTransparent(__value__)") { + const isTransparent = (color: string) => color !== "" && (Color(color).alpha() !== 1); + return isTransparent(StrCast(doc[key])); + } const fieldVal = doc[key]; if (Cast(fieldVal, listSpec("string"), []).length) { const vals = Cast(fieldVal, listSpec("string"), []); |