From ed982a553d1831353e312ae8137afa95ef84ebe5 Mon Sep 17 00:00:00 2001 From: bob Date: Tue, 29 Jan 2019 12:20:13 -0500 Subject: semi working docking, but zooming is now broken. --- src/views/collections/CollectionDockingView.tsx | 59 ++++++++++++++++--------- 1 file changed, 38 insertions(+), 21 deletions(-) (limited to 'src/views/collections/CollectionDockingView.tsx') diff --git a/src/views/collections/CollectionDockingView.tsx b/src/views/collections/CollectionDockingView.tsx index 51323e94b..b6fff6ba0 100644 --- a/src/views/collections/CollectionDockingView.tsx +++ b/src/views/collections/CollectionDockingView.tsx @@ -37,7 +37,7 @@ export class CollectionDockingView extends React.Component { "type": "tab", "name": "CHILD #1", - "component": "grid", + "component": "doc1", } ] }, @@ -49,7 +49,19 @@ export class CollectionDockingView extends React.Component { "type": "tab", "name": "CHILD #2", - "component": "grid", + "component": "doc2", + } + ] + }, + { + "type": "tabset", + "weight": 50, + "selected": 0, + "children": [ + { + "type": "tab", + "name": "CHILD #3", + "component": "doc3", } ] } @@ -107,7 +119,7 @@ export class CollectionDockingView extends React.Component e.stopPropagation(); e.preventDefault(); } else { - if (e.buttons === 1 && SelectionManager.IsSelected(this.props.ContainingDocumentView!)) { + if (e.buttons === 1 && this.active) { e.stopPropagation(); } } @@ -117,14 +129,20 @@ export class CollectionDockingView extends React.Component if (component === "button") { return ; } - if (component === "grid") { - let which = this._times++ % 3; - if (which == 0) - return
- if (which == 1) - return
- if (which == 2) - return
+ console.log("Gettting " + component); + const { fieldKey, Document: Document } = this.props; + const value: Document[] = Document.GetFieldValue(fieldKey, ListField, []); + if (component === "doc1") { + return (); + } + if (component === "doc2") { + return (); + } + if (component === "doc3") { + return (); + } + if (component === "text") { + return (
Panel {node.getName()}
); } } @@ -132,21 +150,20 @@ export class CollectionDockingView extends React.Component const { fieldKey, Document: Document } = this.props; const value: Document[] = Document.GetFieldValue(fieldKey, ListField, []); - const panx: number = Document.GetFieldValue(KeyStore.PanX, NumberField, Number(0)); - const pany: number = Document.GetFieldValue(KeyStore.PanY, NumberField, Number(0)); - const currScale: number = Document.GetFieldValue(KeyStore.Scale, NumberField, Number(1)); + // bcz: not sure why, but I need these to force the flexlayout to update when the collection size changes. + var w = Document.GetFieldValue(KeyStore.Width, NumberField, Number(0)); + var h = Document.GetFieldValue(KeyStore.Height, NumberField, Number(0)); return (
-
e.preventDefault()} style={{ - width: "100%", - height: `calc(100% - 2*${CollectionDockingView.BORDER_WIDTH}px)`, - }} ref={this._containerRef}> -
- -
+
e.preventDefault()} ref={this._containerRef} + style={{ + width: "100%", + height: `calc(100% - 2*${CollectionDockingView.BORDER_WIDTH}px)`, + }} > +
); -- cgit v1.2.3-70-g09d2