Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let onMouseMove: any = moveEvent => {
if (moveEvent.buttons === 0) {
return onMouseUp()
}
const app = this.ref
const cursorPos = moveEvent.clientX - getLeft(app) - offset
const newSize = app.clientWidth - cursorPos
const maxSize = window.innerWidth - 50
const docsSize = maxSize < newSize ? maxSize : newSize
if (docsSize < 100) {
this.props.setDocsVisible(
this.props.sessionId,
false,
this.props.docs.activeTabIdx,
)
} else {
this.props.setDocsVisible(
this.props.sessionId,
true,
this.props.docs.activeTabIdx,
)
private handleDocsResizeStart = downEvent => {
downEvent.preventDefault()
const hadWidth = this.props.docs.docsWidth
const offset = downEvent.clientX - getLeft(downEvent.target)
let onMouseMove: any = moveEvent => {
if (moveEvent.buttons === 0) {
return onMouseUp()
}
const app = this.ref
const cursorPos = moveEvent.clientX - getLeft(app) - offset
const newSize = app.clientWidth - cursorPos
const maxSize = window.innerWidth - 50
const docsSize = maxSize < newSize ? maxSize : newSize
if (docsSize < 100) {
this.props.setDocsVisible(
this.props.sessionId,
false,
let onMouseMove: any = moveEvent => {
if (moveEvent.buttons === 0) {
return onMouseUp()
}
const editorBar = ReactDOM.findDOMNode(this.editorBarComponent)
const leftSize = moveEvent.clientX - getLeft(editorBar) - offset
const rightSize = editorBar.clientWidth - leftSize
this.props.setEditorFlex(leftSize / rightSize)
}
private handleResizeStart = downEvent => {
if (!this.didClickDragBar(downEvent)) {
return
}
downEvent.preventDefault()
const offset = downEvent.clientX - getLeft(downEvent.target)
let onMouseMove: any = moveEvent => {
if (moveEvent.buttons === 0) {
return onMouseUp()
}
const editorBar = ReactDOM.findDOMNode(this.editorBarComponent)
const leftSize = moveEvent.clientX - getLeft(editorBar) - offset
const rightSize = editorBar.clientWidth - leftSize
this.props.setEditorFlex(leftSize / rightSize)
}
let onMouseUp: any = () => {
document.removeEventListener('mousemove', onMouseMove)
document.removeEventListener('mouseup', onMouseUp)
onMouseMove = null