diff options
author | bobzel <zzzman@gmail.com> | 2020-12-16 23:30:57 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-12-16 23:30:57 -0500 |
commit | f4f4cb6b3a639c3e1c0d291f1d290e80097cfa06 (patch) | |
tree | 6280a4c0a2853f021e6527dc90d28ab48369c953 /src | |
parent | 953068d7f2653d0d219246c07c5183ca8ffce3ea (diff) |
fixed unbrushing docs
Diffstat (limited to 'src')
-rw-r--r-- | src/Utils.ts | 2 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index 852a00406..f160df6f7 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -592,7 +592,7 @@ export function lightOrDark(color: any) { } } -export function isTarget(x: number, y: number, target: HTMLDivElement | null) { +export function hasDescendantTarget(x: number, y: number, target: HTMLDivElement | null) { let entered = false; for (let child = document.elementFromPoint(x, y); !entered && child; child = child.parentElement) { entered = entered || child === target; diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index b9ca460b9..e99b0a155 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -9,8 +9,7 @@ import { ScriptField } from '../../../fields/ScriptField'; import { BoolCast, Cast, NumCast, ScriptCast, StrCast } from "../../../fields/Types"; import { GetEffectiveAcl, TraceMobx } from '../../../fields/util'; import { MobileInterface } from '../../../mobile/MobileInterface'; -import { GestureUtils } from '../../../pen-gestures/GestureUtils'; -import { emptyFunction, isTarget as hasDescendantTarget, OmitKeys, returnFalse, returnVal, Utils } from "../../../Utils"; +import { emptyFunction, hasDescendantTarget, OmitKeys, returnFalse, returnVal, Utils } from "../../../Utils"; import { GooglePhotos } from '../../apis/google_docs/GooglePhotosClientUtils'; import { Docs, DocUtils } from "../../documents/Documents"; import { DocumentType } from '../../documents/DocumentTypes'; @@ -832,7 +831,7 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps onPointerDown={this.onPointerDown} onClick={this.onClick} onPointerEnter={e => !SnappingManager.GetIsDragging() && Doc.BrushDoc(this.props.Document)} - onPointerLeave={e => hasDescendantTarget(e.nativeEvent.x, e.nativeEvent.y, this.ContentDiv) && Doc.UnBrushDoc(this.props.Document)} + onPointerLeave={e => !hasDescendantTarget(e.nativeEvent.x, e.nativeEvent.y, this.ContentDiv) && Doc.UnBrushDoc(this.props.Document)} style={{ borderRadius: this.borderRounding, pointerEvents: this.pointerEvents, |