aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/KeyValuePair.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-03-21 00:35:56 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-03-21 00:35:56 -0400
commitcac21da4feeb5cebdda008011ab89bce15b01214 (patch)
treee2d50aa3199160e440a3a9c1617533606bdbcb34 /src/client/views/nodes/KeyValuePair.tsx
parent0d430943b0bab1d63f014aaa3ddf3460785c640e (diff)
parentd882d4013dc2df03a55c3f4afc954b7d9a38b4e4 (diff)
Merge branch 'master' into editableSchema
Diffstat (limited to 'src/client/views/nodes/KeyValuePair.tsx')
-rw-r--r--src/client/views/nodes/KeyValuePair.tsx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/client/views/nodes/KeyValuePair.tsx b/src/client/views/nodes/KeyValuePair.tsx
index 111f85a05..7ed5ee272 100644
--- a/src/client/views/nodes/KeyValuePair.tsx
+++ b/src/client/views/nodes/KeyValuePair.tsx
@@ -1,5 +1,6 @@
import 'react-image-lightbox/style.css'; // This only needs to be imported once in your app
import "./KeyValueBox.scss";
+import "./KeyValuePair.scss";
import React = require("react")
import { FieldViewProps, FieldView } from './FieldView';
import { Opt, Field } from '../../../fields/Field';
@@ -55,7 +56,18 @@ export class KeyValuePair extends React.Component<KeyValuePairProps> {
);
return (
<tr className={this.props.rowStyle}>
- <td>{this.key.Name}</td>
+ {/* <button>X</button> */}
+ <td>
+ <div className="container">
+ <div>{this.key.Name}</div>
+ <button className="delete" onClick={() => {
+ let field = props.doc.Get(props.fieldKey);
+ if (field && field instanceof Field) {
+ props.doc.Set(props.fieldKey, undefined);
+ }
+ }}>X</button>
+ </div>
+ </td>
<td><EditableView contents={contents} height={36} GetValue={() => {
let field = props.doc.Get(props.fieldKey);
if (field && field instanceof Field) {