Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private handleVariableResizeStart = downEvent => {
downEvent.preventDefault()
let didMove = false
const wasOpen = this.props.variableEditorOpen
const hadHeight = this.props.variableEditorHeight
const offset = downEvent.clientY - getTop(downEvent.target)
if (
wasOpen &&
(downEvent.target === this.queryVariablesRef ||
downEvent.target === this.httpHeadersRef)
) {
return
}
let onMouseMove: any = moveEvent => {
if (moveEvent.buttons === 0) {
return onMouseUp()
}
didMove = true
let onMouseMove: any = moveEvent => {
if (moveEvent.buttons === 0) {
return onMouseUp()
}
didMove = true
const editorBar = ReactDOM.findDOMNode(this.editorBarComponent)
const topSize = moveEvent.clientY - getTop(editorBar) - offset
const bottomSize = editorBar.clientHeight - topSize
if (bottomSize < 60) {
this.props.closeVariables(hadHeight)
} else {
this.props.openVariables(bottomSize)
}
}