From 99cc00b9a0d83413acf99d8c1e9854484e831069 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Sun, 20 Oct 2019 23:39:47 -0400 Subject: fixes to imagebox/keyvalue to get images to show up --- src/client/views/nodes/FieldView.tsx | 3 +-- src/client/views/nodes/ImageBox.scss | 3 +++ src/client/views/nodes/ImageBox.tsx | 2 +- src/client/views/nodes/KeyValueBox.tsx | 19 +++++++++++-------- src/client/views/nodes/KeyValuePair.tsx | 6 ++++-- 5 files changed, 20 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/FieldView.tsx b/src/client/views/nodes/FieldView.tsx index 074efaf6c..3b9627efc 100644 --- a/src/client/views/nodes/FieldView.tsx +++ b/src/client/views/nodes/FieldView.tsx @@ -25,7 +25,6 @@ import { ScriptField } from "../../../new_fields/ScriptField"; export interface FieldViewProps { fieldKey: string; fieldExt: string; - leaveNativeSize?: boolean; fitToBox?: boolean; ContainingCollectionView: Opt; ContainingCollectionDoc: Opt; @@ -76,7 +75,7 @@ export class FieldView extends React.Component { return ; } else if (field instanceof ImageField) { - return ; + return ; } // else if (field instaceof PresBox) { // return ; diff --git a/src/client/views/nodes/ImageBox.scss b/src/client/views/nodes/ImageBox.scss index 2b81c16c0..c5265556e 100644 --- a/src/client/views/nodes/ImageBox.scss +++ b/src/client/views/nodes/ImageBox.scss @@ -11,6 +11,9 @@ .imageBox-container { border-radius: inherit; + width:100%; + height:100%; + position: absolute; } .imageBox-cont-interactive { diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index f3ba968f5..ff129cf1d 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -392,7 +392,7 @@ export class ImageBox extends DocAnnotatableComponent { e.stopPropagation(); } + rowHeight = () => 30; + createTable = () => { let doc = this.fieldDocToLayout; if (!doc) { @@ -124,14 +126,15 @@ export class KeyValueBox extends React.Component { let i = 0; const self = this; for (let key of Object.keys(ids).slice().sort()) { - rows.push( { - if (oldEl) self.rows.splice(self.rows.indexOf(oldEl), 1); - oldEl = el; - if (el) self.rows.push(el); - }; - })()} keyWidth={100 - this.splitPercentage} rowStyle={"keyValueBox-" + (i++ % 2 ? "oddRow" : "evenRow")} key={key} keyName={key} />); + rows.push( { + if (oldEl) self.rows.splice(self.rows.indexOf(oldEl), 1); + oldEl = el; + if (el) self.rows.push(el); + }; + })()} keyWidth={100 - this.splitPercentage} rowStyle={"keyValueBox-" + (i++ % 2 ? "oddRow" : "evenRow")} key={key} keyName={key} />); } return rows; } diff --git a/src/client/views/nodes/KeyValuePair.tsx b/src/client/views/nodes/KeyValuePair.tsx index 1fed4c8bb..4e1390200 100644 --- a/src/client/views/nodes/KeyValuePair.tsx +++ b/src/client/views/nodes/KeyValuePair.tsx @@ -22,6 +22,8 @@ export interface KeyValuePairProps { keyName: string; doc: Doc; keyWidth: number; + PanelHeight: () => number; + PanelWidth: () => number; addDocTab: (doc: Doc, data: Opt, where: string) => boolean; } @observer @@ -67,8 +69,8 @@ export class KeyValuePair extends React.Component { whenActiveChanged: emptyFunction, ScreenToLocalTransform: Transform.Identity, focus: emptyFunction, - PanelWidth: returnZero, - PanelHeight: returnZero, + PanelWidth: this.props.PanelWidth, + PanelHeight: this.props.PanelHeight, addDocTab: returnFalse, pinToPres: returnZero, ContentScaling: returnOne -- cgit v1.2.3-70-g09d2