From f9d241406c62b6aba1a84b5947d339c1a4c28a6d Mon Sep 17 00:00:00 2001 From: bob Date: Wed, 30 Jan 2019 13:36:03 -0500 Subject: fixed dragging and doc decorations for all docking locations I think. --- src/views/collections/CollectionDockingView.tsx | 52 +++++++++---------------- 1 file changed, 19 insertions(+), 33 deletions(-) (limited to 'src/views/collections/CollectionDockingView.tsx') diff --git a/src/views/collections/CollectionDockingView.tsx b/src/views/collections/CollectionDockingView.tsx index fd492503d..f08bdaab4 100644 --- a/src/views/collections/CollectionDockingView.tsx +++ b/src/views/collections/CollectionDockingView.tsx @@ -4,7 +4,7 @@ import React = require("react"); import FlexLayout from "flexlayout-react"; import { action, observable, computed } from "mobx"; import { Document } from "../../fields/Document"; -import { DocumentView, CollectionViewProps } from "../nodes/DocumentView"; +import { DocumentView, CollectionViewProps, COLLECTION_BORDER_WIDTH } from "../nodes/DocumentView"; import { ListField } from "../../fields/ListField"; import { NumberField } from "../../fields/NumberField"; import { SSL_OP_SINGLE_DH_USE } from "constants"; @@ -52,9 +52,6 @@ export class CollectionDockingView extends React.Component super(props); } - public static BORDER_WIDTH = 2; - public static TAB_HEADER_HEIGHT = 20; - @computed public get active(): boolean { var isSelected = (this.props.ContainingDocumentView != undefined && SelectionManager.IsSelected(this.props.ContainingDocumentView)); @@ -169,35 +166,24 @@ export class CollectionDockingView extends React.Component var w = Document.GetFieldValue(KeyStore.Width, NumberField, Number(0)) / s; var h = Document.GetFieldValue(KeyStore.Height, NumberField, Number(0)) / s; - if (CollectionDockingView.UseGoldenLayout) { - return ( -
-
e.preventDefault()} ref={this._containerRef} - style={{ - width: "100%", - height: "100%" - }} > -
-
- ); - } else { - return ( -
-
e.preventDefault()} ref={this._containerRef} - style={{ - width: s > 1 ? "100%" : w - 2 * CollectionDockingView.BORDER_WIDTH, - height: s > 1 ? "100%" : h - 2 * CollectionDockingView.BORDER_WIDTH - }} > - -
-
- ); + var chooseLayout = () => { + if (!CollectionDockingView.UseGoldenLayout) + return ; } + + return ( +
+
e.preventDefault()} ref={this._containerRef} + style={{ + width: CollectionDockingView.UseGoldenLayout || s > 1 ? "100%" : w - 2 * COLLECTION_BORDER_WIDTH, + height: CollectionDockingView.UseGoldenLayout || s > 1 ? "100%" : h - 2 * COLLECTION_BORDER_WIDTH + }} > + {chooseLayout()} +
+
+ ); } } \ No newline at end of file -- cgit v1.2.3-70-g09d2