Tracing bug

This commit is contained in:
James Barnsley
2017-11-20 14:12:53 +13:00
parent 99f70d9f5a
commit 7f851b3546
3 changed files with 9 additions and 10 deletions

View File

@ -22,19 +22,19 @@ class ContextMenu extends React.Component{
submenu_expanded: false
}
this.handleScroll = this.handleScroll.bind(this);
this.handleMouseDown = this.handleMouseDown.bind(this);
this.handleMouseUp = this.handleMouseUp.bind(this);
this.handleTouchEnd = this.handleTouchEnd.bind(this);
}
componentDidMount(){
window.addEventListener("scroll", this.handleScroll, false);
window.addEventListener("mousedown", this.handleMouseDown, false);
window.addEventListener("mouseup", this.handleMouseUp, false);
window.addEventListener("touchend", this.handleTouchEnd, false);
}
componentWillUnmount(){
window.removeEventListener("scroll", this.handleScroll, false);
window.removeEventListener("mousedown", this.handleMouseDown, false);
window.removeEventListener("mouseup", this.handleMouseUp, false);
window.removeEventListener("touchend", this.handleTouchEnd, false);
}
@ -78,10 +78,12 @@ class ContextMenu extends React.Component{
}
handleTouchEnd(e){
console.log('ContextMenu > handleTouchEnd');
this.handleClick(e);
}
handleMouseDown(e){
handleMouseUp(e){
console.log('ContextMenu > handleMouseUp');
this.handleClick(e);
}

View File

@ -8,15 +8,11 @@ export default class ContextMenuTrigger extends React.Component{
super(props);
}
handleMouseDown(e){
e.preventDefault();
e.stopPropagation();
handleMouseUp(e){
this.props.onTrigger(e);
}
handleTouchEnd(e){
e.preventDefault();
e.stopPropagation();
this.props.onTrigger(e);
}
@ -27,7 +23,7 @@ export default class ContextMenuTrigger extends React.Component{
}
return (
<span className={className}
onMouseDown={e => this.handleMouseDown(e)}
onMouseUp={e => this.handleMouseUp(e)}
onTouchEnd={e => this.handleTouchEnd(e)}>
<span className="dot"></span>
<span className="dot"></span>

View File

@ -100,6 +100,7 @@ export default class Track extends React.Component{
}
handleContextMenu(e){
console.log('handle');
e.preventDefault();
e.stopPropagation();
e.cancelBubble = true;