diff options
author | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-03-08 12:56:58 -0500 |
---|---|---|
committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-03-08 12:56:58 -0500 |
commit | e7dd6dbdf8d01cef390ff65c0948e5e70ac232cf (patch) | |
tree | 10551b265cb02acb3e8ee23b5f03eb22bf7f31d1 /src/client/views/DocumentDecorations.tsx | |
parent | d47c114193972dabf0d48e789bd58989cdeae605 (diff) | |
parent | 81cfcf5ab5caed1ab5cd052b3e8f00829631018f (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into filters
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r-- | src/client/views/DocumentDecorations.tsx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 44d4460fa..aeb2d582b 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -10,7 +10,7 @@ import { InkField } from "../../fields/InkField"; import { ScriptField } from '../../fields/ScriptField'; import { Cast, NumCast } from "../../fields/Types"; import { GetEffectiveAcl } from '../../fields/util'; -import { setupMoveUpEvents, emptyFunction } from "../../Utils"; +import { setupMoveUpEvents, emptyFunction, returnFalse } from "../../Utils"; import { Docs, DocUtils } from "../documents/Documents"; import { DocumentType } from '../documents/DocumentTypes'; import { CurrentUserUtils } from '../util/CurrentUserUtils'; @@ -129,7 +129,7 @@ export class DocumentDecorations extends React.Component<{ boundsLeft: number, b } @undoBatch @action - onMaximizeClick = (e: React.MouseEvent): void => { + onMaximizeClick = (e: any): void => { const selectedDocs = SelectionManager.Views(); if (selectedDocs.length) { if (e.ctrlKey) { // open an alias in a new tab with Ctrl Key @@ -152,12 +152,12 @@ export class DocumentDecorations extends React.Component<{ boundsLeft: number, b } @undoBatch - onIconifyClick = (e: React.MouseEvent): void => { + onIconifyClick = (): void => { SelectionManager.Views().forEach(dv => dv?.iconify()); SelectionManager.DeselectAll(); } - onSelectorClick = (e: React.MouseEvent) => SelectionManager.Views()?.[0]?.props.ContainingCollectionView?.props.select(false); + onSelectorClick = () => SelectionManager.Views()?.[0]?.props.ContainingCollectionView?.props.select(false); onRadiusDown = (e: React.PointerEvent): void => { this._resizeUndo = UndoManager.StartBatch("DocDecs set radius"); @@ -413,9 +413,10 @@ export class DocumentDecorations extends React.Component<{ boundsLeft: number, b return (!docView.rootDoc._stayInCollection || docView.rootDoc.isInkMask) && (collectionAcl === AclAdmin || collectionAcl === AclEdit || GetEffectiveAcl(docView.rootDoc) === AclAdmin); }); - const topBtn = (key: string, icon: string, click: (e: React.MouseEvent) => void, title: string) => ( + const topBtn = (key: string, icon: string, click: (e: any) => void, title: string) => ( <Tooltip key={key} title={<div className="dash-tooltip">{title}</div>} placement="top"> - <div className={`documentDecorations-${key}Button`} onContextMenu={e => { e.preventDefault(); e.stopPropagation(); }} onClick={click}> + <div className={`documentDecorations-${key}Button`} onContextMenu={e => e.preventDefault()} + onPointerDown={e => setupMoveUpEvents(this, e, returnFalse, click, emptyFunction)} > <FontAwesomeIcon icon={icon as any} /> </div> </Tooltip>); |