From 1047ad746120971073787098ad3f55896f79db07 Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Wed, 15 Feb 2017 19:21:42 +1300 Subject: [PATCH] Adding from_uri to dropzones --- src/js/components/Dropzones.js | 4 ++-- src/js/components/TrackList.js | 2 +- src/js/services/ui/actions.js | 3 ++- src/js/services/ui/reducer.js | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/components/Dropzones.js b/src/js/components/Dropzones.js index 6898645c..a8c01560 100755 --- a/src/js/components/Dropzones.js +++ b/src/js/components/Dropzones.js @@ -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': diff --git a/src/js/components/TrackList.js b/src/js/components/TrackList.js index 96c0e99b..a0d37851 100755 --- a/src/js/components/TrackList.js +++ b/src/js/components/TrackList.js @@ -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) ) } } diff --git a/src/js/services/ui/actions.js b/src/js/services/ui/actions.js index bf219c0f..2a947d43 100755 --- a/src/js/services/ui/actions.js +++ b/src/js/services/ui/actions.js @@ -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, diff --git a/src/js/services/ui/reducer.js b/src/js/services/ui/reducer.js index 991dc4f1..901662b5 100755 --- a/src/js/services/ui/reducer.js +++ b/src/js/services/ui/reducer.js @@ -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,