diff options
author | mehekj <mehek.jethani@gmail.com> | 2021-09-20 22:25:19 -0400 |
---|---|---|
committer | mehekj <mehek.jethani@gmail.com> | 2021-09-20 22:25:19 -0400 |
commit | a8d8c9a115d1de3946a4f3d971c953f4b1222551 (patch) | |
tree | 86f56b6406216e694b9baa93af28f5ed5763c311 /src/Utils.ts | |
parent | 64e265d9cba009469081fdf4ba3272c78a3a76a8 (diff) | |
parent | e295f6694bed9a3a35a0858c8f17745ef1506f51 (diff) |
Merge branch 'master' into temporalmedia-mehek
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index ddc16dceb..e11f1154e 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -125,7 +125,9 @@ export namespace Utils { // bcz: isTransparent(__value__) is a hack. it would be nice to have acual functions be parsed, but now Doc.matchFieldValue is hardwired to recognize just this one return `backgroundColor:${isTransparentFunctionHack},${noRecursionHack}:x`;// bcz: hack. noRecursion should probably be either another ':' delimited field, or it should be a modifier to the comparision (eg., check, x, etc) field } - + export function PropUnsetFilter(prop: string) { + return `${prop}:any,${noRecursionHack}:unset`; + } export function toRGBAstr(col: { r: number, g: number, b: number, a?: number }) { return "rgba(" + col.r + "," + col.g + "," + col.b + (col.a !== undefined ? "," + col.a : "") + ")"; @@ -552,19 +554,23 @@ export function simulateMouseClick(element: Element | null | undefined, x: numbe screenY: sy, }))); - rightClick && element.dispatchEvent( - new MouseEvent("contextmenu", { - view: window, - bubbles: true, - cancelable: true, - button: 2, - clientX: x, - clientY: y, - movementX: 0, - movementY: 0, - screenX: sx, - screenY: sy, - })); + if (rightClick) { + const me = + new MouseEvent("contextmenu", { + view: window, + bubbles: true, + cancelable: true, + button: 2, + clientX: x, + clientY: y, + movementX: 0, + movementY: 0, + screenX: sx, + screenY: sy, + }); + (me as any).dash = true; + element.dispatchEvent(me); + } } export function lightOrDark(color: any) { |