aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ImageBox.tsx
diff options
context:
space:
mode:
authorEleanor Eng <eleanoreng@eleanors-mbp.devices.brown.edu>2019-02-19 18:24:41 -0500
committerEleanor Eng <eleanoreng@eleanors-mbp.devices.brown.edu>2019-02-19 18:24:41 -0500
commite5a14d6dddccc922bb253323b461ac2500c33b7c (patch)
treed3078b7edf89659bbf689c1a346e09a14575bfd2 /src/client/views/nodes/ImageBox.tsx
parent9596bd5b6505fa6e9d32630ed7d824d263cd1e63 (diff)
Different options based on selection
Diffstat (limited to 'src/client/views/nodes/ImageBox.tsx')
-rw-r--r--src/client/views/nodes/ImageBox.tsx11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index 60be5f94d..f363487c3 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -11,6 +11,7 @@ import { FieldWaiting } from '../../../fields/Field';
import { observer } from "mobx-react"
import { observable, action, spy } from 'mobx';
import { KeyStore } from '../../../fields/Key';
+import { ContextMenu } from "../../views/ContextMenu";
@observer
export class ImageBox extends React.Component<FieldViewProps> {
@@ -81,13 +82,21 @@ export class ImageBox extends React.Component<FieldViewProps> {
}
}
+ //REPLACE THIS WITH CAPABILITIES SPECIFC TO THIS TYPE OF NODE
+ imageCapability = (e: React.MouseEvent): void => {
+ }
+
+ specificContextMenu = (e: React.MouseEvent): void => {
+ ContextMenu.Instance.addItem({ description: "Image Capability", event: this.imageCapability });
+ }
+
render() {
let field = this.props.doc.Get(this.props.fieldKey);
let path = field == FieldWaiting ? "https://image.flaticon.com/icons/svg/66/66163.svg" :
field instanceof ImageField ? field.Data.href : "http://www.cs.brown.edu/~bcz/face.gif";
return (
- <div className="imageBox-cont" onPointerDown={this.onPointerDown} ref={this._ref} >
+ <div className="imageBox-cont" onPointerDown={this.onPointerDown} ref={this._ref} onContextMenu={this.specificContextMenu}>
<img src={path} width="100%" alt="Image not found" />
{this.lightbox(path)}
</div>)