aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentButtonBar.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/DocumentButtonBar.tsx')
-rw-r--r--src/client/views/DocumentButtonBar.tsx18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index a9f03a658..b17dbc93d 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -28,6 +28,7 @@ import { DocumentLinksButton } from './nodes/DocumentLinksButton';
import { DocumentView } from './nodes/DocumentView';
import { OpenWhere } from './nodes/OpenWhere';
import { DashFieldView } from './nodes/formattedText/DashFieldView';
+import { SmartDrawHandler } from './smartdraw/SmartDrawHandler';
@observer
export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (DocumentView | undefined)[]; stack?: unknown }> {
@@ -319,7 +320,22 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (
const targetDoc = this.view0?.Document;
return !targetDoc ? null : (
<Tooltip title={<div className="dash-ai-editor-button">Edit with AI</div>}>
- <div className="documentButtonBar-icon" style={{ color: 'white' }} onClick={undoable(() => this.view0?.toggleAIEditor(), 'toggle AI editor')}>
+ <div
+ className="documentButtonBar-icon"
+ style={{ color: 'white' }}
+ onPointerDown={e =>
+ setupMoveUpEvents(
+ this,
+ e,
+ me => {
+ this.view0?.docViewPath().slice(-2)[0]?.ComponentView?.showSmartDraw?.(me.x, me.y, true);
+ SmartDrawHandler.Instance.startDragging(me);
+ return true;
+ },
+ emptyFunction,
+ undoable(() => this.view0?.toggleAIEditor(), 'toggle AI editor')
+ )
+ }>
<FontAwesomeIcon className="documentdecorations-icon" icon="robot" />
</div>
</Tooltip>