From 5628b585fa6356d66cf2e7454be20e3b847ad22e Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 8 Jul 2022 12:37:06 -0400 Subject: fixes for drawing ink on pdf/image/etc. fixes for showing contextMenu. moved gestureOverlay into main dashboard area to avoid drawing on UI widgets. more code cleanup to put things in reasonable places and avoid importing too much stuff. --- src/client/views/nodes/DocumentView.tsx | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index f89c65052..dea718a0d 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -362,7 +362,7 @@ export class DocumentViewInternal extends DocComponent) => { - if (!e.nativeEvent.cancelBubble && !this.props.isSelected()) { + if (!this.props.isSelected()) { e.stopPropagation(); e.preventDefault(); @@ -380,14 +380,14 @@ export class DocumentViewInternal extends DocComponent { - if (e.altKey && !e.nativeEvent.cancelBubble) { + if (e.altKey) { e.stopPropagation(); e.preventDefault(); if (e.key === '†' || e.key === 't') { @@ -543,7 +543,7 @@ export class DocumentViewInternal extends DocComponent { - if (!e.nativeEvent.cancelBubble && !this.Document.ignoreClick && this.props.renderDepth >= 0 && Math.abs(e.clientX - this._downX) < Utils.DRAG_THRESHOLD && Math.abs(e.clientY - this._downY) < Utils.DRAG_THRESHOLD) { + if (!this.Document.ignoreClick && this.props.renderDepth >= 0 && Math.abs(e.clientX - this._downX) < Utils.DRAG_THRESHOLD && Math.abs(e.clientY - this._downY) < Utils.DRAG_THRESHOLD) { let stopPropagate = true; let preventDefault = true; const isScriptBox = () => StrCast(Doc.LayoutField(this.layoutDoc))?.includes(ScriptingBox.name); @@ -643,11 +643,8 @@ export class DocumentViewInternal extends DocComponent 0))) { // if this is part of a template, let the event go up to the tempalte root unless right/ctrl clicking - !(this.props.Document.rootDocument && !(e.ctrlKey || e.button > 0)) - ) { if ( (this.props.isDocumentActive?.() || this.layoutDoc.onDragStart) && !this.props.onBrowseClick?.() && @@ -792,7 +789,6 @@ export class DocumentViewInternal extends DocComponent { - if (e?.nativeEvent.cancelBubble) return; if (e && this.rootDoc._hideContextMenu && Doc.noviceMode) { e.preventDefault(); e.stopPropagation(); -- cgit v1.2.3-70-g09d2