Adding from_uri to dropzones

This commit is contained in:
James Barnsley
2017-02-15 19:21:42 +13:00
parent b8d01ea1f9
commit 1047ad7461
4 changed files with 6 additions and 4 deletions

View File

@ -49,11 +49,11 @@ class Dropzones extends React.Component{
switch( target.action ){
case 'enqueue':
this.props.mopidyActions.enqueueURIs( uris )
this.props.mopidyActions.enqueueURIs( uris, this.props.dragger.from_uri )
break
case 'enqueue_next':
this.props.mopidyActions.enqueueURIsNext( uris )
this.props.mopidyActions.enqueueURIsNext( uris, this.props.dragger.from_uri )
break
case 'add_to_playlist':

View File

@ -88,7 +88,7 @@ class TrackList extends React.Component{
if (!this.state.tracks[index].selected && !this.isRightClick(e) && !e.ctrlKey) this.toggleTrackSelections(e, index)
var selected_tracks = this.selectedTracks()
this.props.uiActions.dragStart( e, this.props.context, selected_tracks, this.tracksIndexes(selected_tracks) )
this.props.uiActions.dragStart( e, this.props.context, this.props.uri, selected_tracks, this.tracksIndexes(selected_tracks) )
}
}

View File

@ -56,10 +56,11 @@ export function toggleSidebar( new_state = 'toggle' ){
return action
}
export function dragStart( e, context, victims, victims_indexes = false ){
export function dragStart( e, context, from_uri = null, victims, victims_indexes = null ){
return {
type: 'DRAG_START',
context: context,
from_uri: from_uri,
victims: victims,
victims_indexes: victims_indexes,
start_x: e.clientX,

View File

@ -54,6 +54,7 @@ export default function reducer(ui = {}, action){
dragging: true,
active: false,
context: action.context,
from_uri: action.from_uri,
victims: action.victims,
victims_indexes: action.victims_indexes,
start_x: action.start_x,