From 189b6c30f69f8cf461d962a63c966232235187df Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 14 Dec 2020 22:04:55 -0500 Subject: moved onClick into DocumentViewProps from shared props. --- src/client/views/nodes/DocumentView.tsx | 4 ++-- src/client/views/nodes/formattedText/FormattedTextBox.tsx | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 9405b1ed5..c2c863284 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -74,7 +74,6 @@ export interface DocumentViewSharedProps { pinToPres: (document: Doc) => void; ScreenToLocalTransform: () => Transform; bringToFront: (doc: Doc, sendToBack?: boolean) => void; - onClick?: () => ScriptField; dropAction?: dropActionType; dontRegisterView?: boolean; ignoreAutoHeight?: boolean; @@ -95,6 +94,7 @@ export interface DocumentViewProps extends DocumentViewSharedProps { NativeHeight?: () => number; LayoutTemplate?: () => Opt; contextMenuItems?: () => { script: ScriptField, label: string }[]; + onClick?: () => ScriptField; onDoubleClick?: () => ScriptField; onPointerDown?: () => ScriptField; onPointerUp?: () => ScriptField; @@ -1190,7 +1190,7 @@ export class DocumentView extends React.Component { ScreenToLocalTransform: this.screenToLocalTransform, focus: this.props.focus || emptyFunction, bringToFront: emptyFunction, - } + }; return (
{!this.props.Document || !this.props.PanelWidth() ? (null) : (
{ - this.doLinkOnDeselect(); FormattedTextBoxComment.textBox = this; - if (this.props.onClick && e.button === 0 && !this.props.isSelected(false)) { - e.preventDefault(); - } if (e.button === 0 && this.props.isSelected(true) && !e.altKey && !e.ctrlKey && !e.metaKey) { if (e.clientX < this.ProseRef!.getBoundingClientRect().right) { // stop propagation if not in sidebar e.stopPropagation(); // if the text box is selected, then it consumes all down events @@ -1715,7 +1708,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
-- cgit v1.2.3-70-g09d2