From bde8aabad7e5745b4797e73b564e4efb19faeca9 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Fri, 1 Mar 2019 00:13:35 -0500
Subject: minor cleanup

---
 src/client/views/nodes/KeyValueBox.tsx | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

(limited to 'src/client/views/nodes/KeyValueBox.tsx')

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">
-- 
cgit v1.2.3-70-g09d2

