aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionStackingView.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-05-30 00:20:35 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-05-30 00:20:35 -0400
commit83edfcd06b659839f161121728de02aca91d4af8 (patch)
treeebfe5f4a3686f41b18b39c27f49d3ab283023a5f /src/client/views/collections/CollectionStackingView.tsx
parent9dbf61fccc96f7c4d6bd63e25a7208b82df28705 (diff)
added image rotation. added double click on stacking views. need to cleanup/fix DocumentView click events
Diffstat (limited to 'src/client/views/collections/CollectionStackingView.tsx')
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 6d44aa37d..943e8dd5f 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -83,10 +83,17 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) {
})
}
onClick = (e: React.MouseEvent) => {
+ let hitBackground = (e.target as any).className === "collectionStackingView-masonryGrid" ||
+ (e.target as any).className === "collectionStackingView";
if (this.props.active()) {
- let rect = (this.masonryGridRef!.firstChild! as HTMLElement).getBoundingClientRect();
- if (e.clientX < rect.left || e.clientX > rect.right || e.clientY > rect.bottom) this.props.select(false);
- e.stopPropagation();
+ if (!hitBackground)
+ e.stopPropagation();
+ }
+ if (hitBackground) {
+ if (!this.props.active() && this.props.ContainingCollectionView && this.props.ContainingCollectionView.props.active()) {
+ e.stopPropagation();
+ }
+ this.props.select(false);
}
}
render() {
@@ -96,7 +103,7 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) {
let cells = Math.floor((this.props.PanelWidth() - leftMargin) / (itemCols * (this.gridSize + this.gridGap)));
return (
<div className="collectionStackingView" ref={this.createRef} onClick={this.onClick} onWheel={(e: React.WheelEvent) => e.stopPropagation()}>
- <div className="collectionStackingview-masonryGrid"
+ <div className="collectionStackingView-masonryGrid"
style={{
padding: `${topMargin}px 0px 0px ${leftMargin}px`,
width: `${cells * itemCols * (this.gridSize + this.gridGap) + leftMargin}`,