aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/KeyValueBox.scss7
-rw-r--r--src/client/views/nodes/KeyValueBox.tsx12
-rw-r--r--src/client/views/nodes/KeyValuePair.tsx5
3 files changed, 15 insertions, 9 deletions
diff --git a/src/client/views/nodes/KeyValueBox.scss b/src/client/views/nodes/KeyValueBox.scss
index f22989735..1295266e5 100644
--- a/src/client/views/nodes/KeyValueBox.scss
+++ b/src/client/views/nodes/KeyValueBox.scss
@@ -6,6 +6,13 @@
border-style: solid;
box-sizing: border-box;
display: inline-block;
+ .imageBox-cont img {
+ max-height:45px;
+ height: auto;
+ }
+}
+.keyValueBox-table {
+ position: relative;
}
.keyValueBox-header {
background:gray;
diff --git a/src/client/views/nodes/KeyValueBox.tsx b/src/client/views/nodes/KeyValueBox.tsx
index 75e2952b7..e8ebd50be 100644
--- a/src/client/views/nodes/KeyValueBox.tsx
+++ b/src/client/views/nodes/KeyValueBox.tsx
@@ -4,7 +4,7 @@ import { observer } from "mobx-react";
import { EditorView } from 'prosemirror-view';
import 'react-image-lightbox/style.css'; // This only needs to be imported once in your app
import { Document } from '../../../fields/Document';
-import { Opt } from '../../../fields/Field';
+import { Opt, FieldWaiting } from '../../../fields/Field';
import { KeyStore } from '../../../fields/KeyStore';
import { FieldView, FieldViewProps } from './FieldView';
import { KeyValuePair } from "./KeyValuePair";
@@ -43,10 +43,8 @@ export class KeyValueBox extends React.Component<FieldViewProps> {
}
createTable = () => {
- let table: Array<JSX.Element> = []
- let ret = "waiting"
let doc = this.props.doc.GetT(KeyStore.Data, Document);
- if (!doc || doc == "<Waiting>") {
+ if (!doc || doc == FieldWaiting) {
return <tr><td>Loading...</td></tr>
}
let realDoc = doc;
@@ -64,9 +62,7 @@ export class KeyValueBox extends React.Component<FieldViewProps> {
let rows: JSX.Element[] = [];
let i = 0;
for (let key in ids) {
- if (i++ % 2 == 0)
- rows.push(<KeyValuePair doc={realDoc} rowStyle="keyValueBox-evenRow" fieldId={key} key={key} />)
- else rows.push(<KeyValuePair doc={realDoc} rowStyle="keyValueBox-oddRow" fieldId={key} key={key} />)
+ rows.push(<KeyValuePair doc={realDoc} rowStyle={"keyValueBox-" + (i++ % 2 ? "oddRow" : "evenRow")} fieldId={key} key={key} />)
}
return rows;
}
@@ -74,7 +70,7 @@ export class KeyValueBox extends React.Component<FieldViewProps> {
render() {
- return (<div className="keyValueBox-cont">
+ return (<div className="keyValueBox-cont" onWheel={this.onPointerWheel}>
<table className="keyValueBox-table">
<tbody>
<tr className="keyValueBox-header">
diff --git a/src/client/views/nodes/KeyValuePair.tsx b/src/client/views/nodes/KeyValuePair.tsx
index ecdd47a1e..a97e98313 100644
--- a/src/client/views/nodes/KeyValuePair.tsx
+++ b/src/client/views/nodes/KeyValuePair.tsx
@@ -49,7 +49,10 @@ export class KeyValuePair extends React.Component<KeyValuePairProps> {
selectOnLoad: false,
}
return (
- <tr className={this.props.rowStyle}><td>{this.key.Name}</td><td><FieldView {...props} /></td></tr>
+ <tr className={this.props.rowStyle}>
+ <td>{this.key.Name}</td>
+ <td><FieldView {...props} /></td>
+ </tr>
)
}
} \ No newline at end of file