From e6871754b90e2179a140c6f0c365b95be80e245b Mon Sep 17 00:00:00 2001
From: Tyler Schicke <tyler_schicke@brown.edu>
Date: Sun, 3 Feb 2019 22:35:33 -0500
Subject: Added preview box in schema view, added ScrollBox control, added
 resizable grid layout, cleaned up some styling for collection freeform view

---
 src/util/ScrollBox.tsx | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 src/util/ScrollBox.tsx

(limited to 'src/util/ScrollBox.tsx')

diff --git a/src/util/ScrollBox.tsx b/src/util/ScrollBox.tsx
new file mode 100644
index 000000000..b6b088170
--- /dev/null
+++ b/src/util/ScrollBox.tsx
@@ -0,0 +1,21 @@
+import React = require("react")
+
+export class ScrollBox extends React.Component {
+    onWheel = (e: React.WheelEvent) => {
+        if (e.currentTarget.scrollHeight > e.currentTarget.clientHeight) { // If the element has a scroll bar, then we don't want the containing collection to zoom
+            e.stopPropagation();
+        }
+    }
+
+    render() {
+        return (
+            <div style={{
+                overflow: "auto",
+                width: "100%",
+                height: "100%",
+            }} onWheel={this.onWheel}>
+                {this.props.children}
+            </div>
+        )
+    }
+}
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

