aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
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
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')
-rw-r--r--src/client/views/collections/CollectionStackingView.scss2
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx15
2 files changed, 12 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionStackingView.scss b/src/client/views/collections/CollectionStackingView.scss
index 0e4a8bb7e..4d240342c 100644
--- a/src/client/views/collections/CollectionStackingView.scss
+++ b/src/client/views/collections/CollectionStackingView.scss
@@ -31,7 +31,7 @@
align-items: center;
}
- .collectionStackingview-masonryGrid {
+ .collectionStackingView-masonryGrid {
display:grid;
width:100%;
height:100%;
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}`,