Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Max Erenberg
2020-09-01 02:10:59 -04:00
100 changed files with 4777 additions and 2374 deletions

View File

@ -39,6 +39,42 @@ class PlaybackControls extends React.Component {
};
}
setTransition(direction) {
this.setState({
transition_track: this.state.current_track,
transition_direction: direction,
});
// Allow time for the animation to complete, then remove
// the transitioning track from state
setTimeout(() => {
this.setState({
transition_track: null,
});
},
250);
}
handleContextMenu = (e) => {
const {
current_track,
} = this.state;
const {
uiActions: {
showContextMenu,
},
} = this.props;
e.preventDefault();
showContextMenu({
e,
context: 'current-track',
items: [current_track],
uris: [current_track.uri],
});
}
handleTouchStart = (e) => {
const { touch_enabled } = this.props;
if (!touch_enabled) return;
@ -94,22 +130,6 @@ class PlaybackControls extends React.Component {
e.preventDefault();
}
setTransition(direction) {
this.setState({
transition_track: this.state.current_track,
transition_direction: direction,
});
// Allow time for the animation to complete, then remove
// the transitioning track from state
setTimeout(() => {
this.setState({
transition_track: null,
});
},
250);
}
renderPlayButton() {
let button = <button className="control play" onClick={() => this.props.mopidyActions.play()}><Icon name="play_circle_filled" type="material" /></button>;
if (this.props.play_state == 'playing') {
@ -228,6 +248,7 @@ class PlaybackControls extends React.Component {
className="current-track current-track__incoming"
onTouchStart={this.handleTouchStart}
onTouchEnd={this.handleTouchEnd}
onContextMenu={this.handleContextMenu}
tabIndex="-1"
key={current_track.tlid}
>