diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/collectionGrid/CollectionGridView.tsx | 16 | ||||
-rw-r--r-- | src/client/views/collections/collectionGrid/Grid.tsx | 10 |
2 files changed, 18 insertions, 8 deletions
diff --git a/src/client/views/collections/collectionGrid/CollectionGridView.tsx b/src/client/views/collections/collectionGrid/CollectionGridView.tsx index 5eeaa9b0d..f503c38d1 100644 --- a/src/client/views/collections/collectionGrid/CollectionGridView.tsx +++ b/src/client/views/collections/collectionGrid/CollectionGridView.tsx @@ -286,6 +286,7 @@ export class CollectionGridView extends CollectionSubView(GridSchema) { // console.log(layout[0].w); // } + console.log(this.props.Document.title + " " + this.props.isSelected() + " " + (!this.props.isSelected() && this.props.renderDepth !== 0 && !this.props.ContainingCollectionView?._isChildActive && !SnappingManager.GetIsDragging() ? "none" : undefined)); return ( <div className="collectionGridView-contents" style={{ @@ -294,7 +295,16 @@ export class CollectionGridView extends CollectionSubView(GridSchema) { pointerEvents: !this.props.isSelected() && this.props.renderDepth !== 0 && !this.props.ContainingCollectionView?._isChildActive && !SnappingManager.GetIsDragging() ? "none" : undefined }} ref={this.createDashEventsTarget} - onPointerDown={e => { ((e.target as any)?.className.includes("react-resizable-handle")) && e.stopPropagation(); }} // the grid doesn't stopPropagation when its widgets are hit, so we need to otherwise the outer documents will respond + onPointerDown={e => { + if (this.props.active(true)) { + if (this.props.isSelected(true)) { + e.stopPropagation(); + } + } + if (this.props.isSelected(true)) { + !((e.target as any)?.className.includes("react-resizable-handle")) && e.preventDefault(); + } + }} // the grid doesn't stopPropagation when its widgets are hit, so we need to otherwise the outer documents will respond > <div className="collectionGridView-gridContainer" ref={this.containerRef} @@ -304,11 +314,11 @@ export class CollectionGridView extends CollectionSubView(GridSchema) { width={this.props.PanelWidth()} nodeList={contents} layout={layout} + childrenDraggable={this.props.isSelected() ? true : false} numCols={this.props.Document.numCols as number} rowHeight={this.props.Document.rowHeight as number} setLayout={this.setLayout} - flex={this.props.Document.flexGrid as boolean} - scale={this.props.ScreenToLocalTransform().Scale} + transformScale={this.props.ScreenToLocalTransform().Scale} /> </div> </div> diff --git a/src/client/views/collections/collectionGrid/Grid.tsx b/src/client/views/collections/collectionGrid/Grid.tsx index be6c4343a..542edb1cd 100644 --- a/src/client/views/collections/collectionGrid/Grid.tsx +++ b/src/client/views/collections/collectionGrid/Grid.tsx @@ -17,8 +17,8 @@ interface GridProps { numCols: number; rowHeight: number; setLayout: Function; - flex: boolean; - scale: number; + transformScale: number; + childrenDraggable: boolean; } /** @@ -43,7 +43,7 @@ export default class Grid extends React.Component<GridProps> { } render() { - console.log(this.props.scale); + console.log(this.props.transformScale); return ( <GridLayout className="layout" layout={this.props.layout} @@ -52,12 +52,12 @@ export default class Grid extends React.Component<GridProps> { width={this.props.width} compactType={null} isDroppable={true} + isDraggable={this.props.childrenDraggable} // useCSSTransforms={true} margin={[10, 10]} onLayoutChange={this.onLayoutChange} preventCollision={false} // change this to true later - // transformScale={2} // 1.2/scale - onDrop={({ x, y, e }) => { console.log("Grid -> render -> x, y, e", x, y, e) }} + // transformScale={2} // 1.2/scale > {this.props.nodeList} </GridLayout > |