diff options
| author | Hannah Chow <hannah_chow@brown.edu> | 2019-03-05 17:38:50 -0500 |
|---|---|---|
| committer | Hannah Chow <hannah_chow@brown.edu> | 2019-03-05 17:38:50 -0500 |
| commit | e64667c09f72e69f8121039809b48167a1d55465 (patch) | |
| tree | 95b55ddc6dcdce566d127ee35d00dbb8bd56c567 /src/client/views/nodes/FormattedTextBox.tsx | |
| parent | 9724ff4d5de3c776b34f5d733fd37845b863f29b (diff) | |
| parent | bb1d3120f11a47e9d493202c1003dae52bf6667f (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into hannah_linking
Diffstat (limited to 'src/client/views/nodes/FormattedTextBox.tsx')
| -rw-r--r-- | src/client/views/nodes/FormattedTextBox.tsx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx index e65615af4..04eb2052d 100644 --- a/src/client/views/nodes/FormattedTextBox.tsx +++ b/src/client/views/nodes/FormattedTextBox.tsx @@ -10,6 +10,7 @@ import "./FormattedTextBox.scss"; import React = require("react") import { RichTextField } from "../../../fields/RichTextField"; import { FieldViewProps, FieldView } from "./FieldView"; +import { ContextMenu } from "../../views/ContextMenu"; @@ -112,12 +113,36 @@ export class FormattedTextBox extends React.Component<FieldViewProps> { e.stopPropagation(); } } + + //REPLACE THIS WITH CAPABILITIES SPECIFIC TO THIS TYPE OF NODE + textCapability = (e: React.MouseEvent): void => { + } + + specificContextMenu = (e: React.MouseEvent): void => { + ContextMenu.Instance.addItem({ description: "Text Capability", event: this.textCapability }); + // ContextMenu.Instance.addItem({ + // description: "Submenu", + // items: [ + // { + // description: "item 1", event: + // }, + // { + // description: "item 2", event: + // } + // ] + // }) + // e.stopPropagation() + + } + onPointerWheel = (e: React.WheelEvent): void => { e.stopPropagation(); } + render() { return (<div className="formattedTextBox-cont" onPointerDown={this.onPointerDown} + onContextMenu={this.specificContextMenu} onWheel={this.onPointerWheel} ref={this._ref} />) } |
