0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-05 05:52:46 +00:00

revert moving pointerMove & pointerUp, now on splitPane

This commit is contained in:
Gazook89
2023-08-01 13:52:44 -05:00
parent 310faa449d
commit 2e13eed2ef

View File

@@ -63,6 +63,7 @@ const SplitPane = createClass({
handleUp : function(e){ handleUp : function(e){
e.preventDefault(); e.preventDefault();
console.log('up');
if(this.state.isDragging){ if(this.state.isDragging){
this.props.onDragFinish(this.state.currentDividerPos); this.props.onDragFinish(this.state.currentDividerPos);
window.localStorage.setItem(this.props.storageKey, this.state.currentDividerPos); window.localStorage.setItem(this.props.storageKey, this.state.currentDividerPos);
@@ -72,6 +73,8 @@ const SplitPane = createClass({
handleDown : function(e){ handleDown : function(e){
e.preventDefault(); e.preventDefault();
console.log('down');
this.setState({ isDragging: true }); this.setState({ isDragging: true });
//this.unFocus() //this.unFocus()
}, },
@@ -79,6 +82,8 @@ const SplitPane = createClass({
handleMove : function(e){ handleMove : function(e){
e.preventDefault(); e.preventDefault();
console.log('move');
if(!this.state.isDragging) return; if(!this.state.isDragging) return;
const newSize = this.limitPosition(e.pageX); const newSize = this.limitPosition(e.pageX);
@@ -125,7 +130,7 @@ const SplitPane = createClass({
renderDivider : function(){ renderDivider : function(){
return <> return <>
{this.renderMoveArrows()} {this.renderMoveArrows()}
<div className='divider' onPointerDown={this.handleDown} onPointerMove={this.handleMove} onPointerUp={this.handleUp} > <div className='divider' onPointerDown={this.handleDown} >
<div className='dots'> <div className='dots'>
<i className='fas fa-circle' /> <i className='fas fa-circle' />
<i className='fas fa-circle' /> <i className='fas fa-circle' />
@@ -136,7 +141,7 @@ const SplitPane = createClass({
}, },
render : function(){ render : function(){
return <div className='splitPane'> return <div className='splitPane' onPointerMove={this.handleMove} onPointerUp={this.handleUp}>
<Pane <Pane
ref='pane1' ref='pane1'
width={this.state.currentDividerPos} width={this.state.currentDividerPos}