Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
remove bind
Browse files Browse the repository at this point in the history
  • Loading branch information
cuiyuan committed Aug 9, 2018
1 parent abe4968 commit d7ac1ba
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions web/src/index/component/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ export default class Sidebar extends Component {

showViewSummaryTrigger(e, name) {
e.preventDefault();
e.stopPropagation();
e.nativeEvent.stopImmediatePropagation();
e.cancelBubble = true;
this.state.showViewSummaryTrigger[name] = true;
this.setState({
showViewSummaryTrigger: this.state.showViewSummaryTrigger
Expand All @@ -105,9 +102,6 @@ export default class Sidebar extends Component {

hideViewSummaryTrigger(e, name) {
e.preventDefault();
e.stopPropagation();
e.nativeEvent.stopImmediatePropagation();
e.cancelBubble = true;
this.state.showViewSummaryTrigger[name] = false;
this.setState({
showViewSummaryTrigger: this.state.showViewSummaryTrigger
Expand Down Expand Up @@ -198,8 +192,8 @@ export default class Sidebar extends Component {
return (
<li key={index}
onClick={(e, name) => this.dataClick(e, item.name)}
onMouseOver={(e, name) => this.showViewSummaryTrigger.bind(this, e, item.name)}
onMouseOut={(e, name) => this.hideViewSummaryTrigger.bind(this, e, item.name)}
onMouseOver={(e, name) => this.showViewSummaryTrigger(e, item.name)}
onMouseOut={(e, name) => this.hideViewSummaryTrigger(e, item.name)}
title={item.name}
className={item.name === this.props.dataName ? 'active' : ''}
ref={'li' + item.name}
Expand Down

0 comments on commit d7ac1ba

Please sign in to comment.