@@ -72,6 +72,7 @@ class Editor extends React.Component {
72
72
allComponentTypes : componentTypes ,
73
73
isQueryPaneDragging : false ,
74
74
queryPaneHeight : 70 ,
75
+ isTopOfQueryPane : false ,
75
76
isLoading : true ,
76
77
users : null ,
77
78
appId,
@@ -117,8 +118,21 @@ class Editor extends React.Component {
117
118
}
118
119
119
120
onMouseMove = ( e ) => {
121
+ const componentTop = Math . round ( this . queryPaneRef . current . getBoundingClientRect ( ) . top ) ;
122
+ const clientY = e . clientY ;
123
+
124
+ if ( ( clientY >= componentTop ) & ( clientY <= componentTop + 5 ) ) {
125
+ this . setState ( {
126
+ isTopOfQueryPane : true ,
127
+ } ) ;
128
+ } else {
129
+ this . setState ( {
130
+ isTopOfQueryPane : false ,
131
+ } ) ;
132
+ }
133
+
120
134
if ( this . state . isQueryPaneDragging ) {
121
- let queryPaneHeight = ( e . clientY / window . screen . height ) * 100 ;
135
+ let queryPaneHeight = ( clientY / window . innerHeight ) * 100 ;
122
136
123
137
if ( queryPaneHeight > 95 ) queryPaneHeight = 100 ;
124
138
if ( queryPaneHeight < 4.5 ) queryPaneHeight = 4.5 ;
@@ -965,21 +979,13 @@ class Editor extends React.Component {
965
979
ref = { this . queryPaneRef }
966
980
onTouchEnd = { this . onMouseUp }
967
981
onMouseDown = { this . onMouseDown }
968
- className = "query-pane"
969
- style = { {
970
- height : `calc(100% - ${ this . state . queryPaneHeight - 1 } %)` ,
971
- background : 'transparent' ,
972
- border : 0 ,
973
- cursor : 'row-resize' ,
974
- } }
975
- > </ div >
976
- < div
977
982
className = "query-pane"
978
983
style = { {
979
984
height : `calc(100% - ${ this . state . queryPaneHeight } %)` ,
980
985
width : ! showLeftSidebar ? '85%' : '' ,
981
986
left : ! showLeftSidebar ? '0' : '' ,
982
- cursor : this . state . isQueryPaneDragging ? 'row-resize' : 'default' ,
987
+ // transition: 'height 0.3s ease-in-out',
988
+ cursor : this . state . isQueryPaneDragging || this . state . isTopOfQueryPane ? 'row-resize' : 'default' ,
983
989
} }
984
990
>
985
991
< div className = "row main-row" >
0 commit comments