Skip to content
Snippets Groups Projects
Commit e2c2bd39 authored by Chris Garrity's avatar Chris Garrity
Browse files

remove callbacks

parent ab1537da
No related branches found
No related tags found
No related merge requests found
...@@ -77,27 +77,29 @@ class LibraryComponent extends React.Component { ...@@ -77,27 +77,29 @@ class LibraryComponent extends React.Component {
selectedTag: tag.toLowerCase() selectedTag: tag.toLowerCase()
}); });
} else { } else {
const playingId = this.state.playingItem; this.props.onItemMouseLeave(this.getFilteredData()[[this.state.playingItem]]);
this.setState({ this.setState({
filterQuery: '', filterQuery: '',
playingItem: null, playingItem: null,
selectedTag: tag.toLowerCase() selectedTag: tag.toLowerCase()
}, this.props.onItemMouseLeave(this.getFilteredData()[[playingId]])); });
} }
} }
handleMouseEnter (id) { handleMouseEnter (id) {
// don't restart if mouse over already playing item // don't restart if mouse over already playing item
if (this.props.onItemMouseEnter && this.state.playingItem !== id) { if (this.props.onItemMouseEnter && this.state.playingItem !== id) {
this.props.onItemMouseEnter(this.getFilteredData()[id]);
this.setState({ this.setState({
playingItem: id playingItem: id
}, this.props.onItemMouseEnter(this.getFilteredData()[id])); });
} }
} }
handleMouseLeave (id) { handleMouseLeave (id) {
if (this.props.onItemMouseLeave) { if (this.props.onItemMouseLeave) {
this.props.onItemMouseLeave(this.getFilteredData()[id]);
this.setState({ this.setState({
playingItem: null playingItem: null
}, this.props.onItemMouseLeave(this.getFilteredData()[id])); });
} }
} }
handlePlayingEnd () { handlePlayingEnd () {
...@@ -114,12 +116,12 @@ class LibraryComponent extends React.Component { ...@@ -114,12 +116,12 @@ class LibraryComponent extends React.Component {
selectedTag: ALL_TAG.tag selectedTag: ALL_TAG.tag
}); });
} else { } else {
const playingId = this.state.playingItem; this.props.onItemMouseLeave(this.getFilteredData()[[this.state.playingItem]]);
this.setState({ this.setState({
filterQuery: event.target.value, filterQuery: event.target.value,
playingItem: null, playingItem: null,
selectedTag: ALL_TAG.tag selectedTag: ALL_TAG.tag
}, this.props.onItemMouseLeave(this.getFilteredData()[[playingId]])); });
} }
} }
handleFilterClear () { handleFilterClear () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment