From d70a74479df87908de7a7b4df7c24c6b267bf9e3 Mon Sep 17 00:00:00 2001 From: vera-liu Date: Wed, 9 Nov 2016 14:21:43 -0800 Subject: [PATCH] Make Sqllab a one-page app -- body not scrollable (#1551) * Make Sqllab a one-page app -- body not scrollable * Add scroll-container and scroll-content in main.css --- .../SqlLab/components/SqlEditor.jsx | 34 +++--- .../SqlLab/components/SqlEditorLeftBar.jsx | 108 +++++++++--------- caravel/assets/javascripts/SqlLab/main.css | 24 +++- 3 files changed, 92 insertions(+), 74 deletions(-) diff --git a/caravel/assets/javascripts/SqlLab/components/SqlEditor.jsx b/caravel/assets/javascripts/SqlLab/components/SqlEditor.jsx index 231a146f1d..db77ed7d3b 100644 --- a/caravel/assets/javascripts/SqlLab/components/SqlEditor.jsx +++ b/caravel/assets/javascripts/SqlLab/components/SqlEditor.jsx @@ -227,22 +227,24 @@ class SqlEditor extends React.PureComponent { -
- - {editorBottomBar} -
- +
+
+ + {editorBottomBar} +
+ +
diff --git a/caravel/assets/javascripts/SqlLab/components/SqlEditorLeftBar.jsx b/caravel/assets/javascripts/SqlLab/components/SqlEditorLeftBar.jsx index 24afa279f0..420b2c80c1 100644 --- a/caravel/assets/javascripts/SqlLab/components/SqlEditorLeftBar.jsx +++ b/caravel/assets/javascripts/SqlLab/components/SqlEditorLeftBar.jsx @@ -99,62 +99,64 @@ class SqlEditorLeftBar extends React.PureComponent { } const shouldShowReset = window.location.search === '?reset=1'; return ( -
- {networkAlert} -
- ( -
- Database: {o.label} -
- )} - /> -
-
- -
-
-
- {this.props.tables.map((table) => ( - +
+ {networkAlert} +
+ ( +
+ Database: {o.label} +
+ )} /> - ))} +
+
+ +
+
+
+ {this.props.tables.map((table) => ( + + ))} +
+ {shouldShowReset && + + }
- {shouldShowReset && - - }
); } diff --git a/caravel/assets/javascripts/SqlLab/main.css b/caravel/assets/javascripts/SqlLab/main.css index 2cee79c75b..ae7d3e8232 100644 --- a/caravel/assets/javascripts/SqlLab/main.css +++ b/caravel/assets/javascripts/SqlLab/main.css @@ -1,3 +1,6 @@ +body { + overflow: hidden; +} .inlineBlock { display: inline-block; } @@ -29,11 +32,22 @@ padding-bottom: 5px; } -.scrollbar { - position: relative; - width: 100%; - overflow-y: auto; - height: 100%; +.scrollbar-container { + position: relative; + overflow: hidden; + width: 100%; + height: 95%; +} + +.scrollbar-content { + position: absolute; + top: 0px; + left: 0px; + right: 0px; + bottom: 0px; + overflow: scroll; + margin-right: 0px; + margin-bottom: 100px; } .Workspace .btn-sm {