Dragging vs context menu vs selection vs ctrl

This commit is contained in:
James Barnsley
2016-11-16 14:58:08 +13:00
parent 98770441cc
commit 86b9665ec8
9 changed files with 108 additions and 64 deletions

View File

@ -59,15 +59,17 @@ export function dragEnd(){
return { type: 'DRAG_END' }
}
export function reorderPlaylistTracks( uri, indexes, to_index ){
export function reorderPlaylistTracks( uri, indexes, to_index, snapshot_id = false ){
switch( helpers.uriSource( uri ) ){
case 'spotify':
// TODO: handle bunched selected tracks (ie non-continuious indexes)
return {
type: 'SPOTIFY_REORDER_PLAYLIST_TRACKS',
uri: uri,
indexes: indexes,
to_index: to_index
to_index: to_index,
snapshot_id: snapshot_id
}
case 'm3u':

View File

@ -233,13 +233,13 @@ export default function reducer(ui = {}, action){
case 'PLAYLIST_TRACKS_LOADED':
var playlist = Object.assign({}, ui.playlist, { tracks: action.tracks })
return Object.assign({}, ui, { playlist: playlist });
/*
case 'PLAYLIST_TRACKS_REORDERED':
var snapshot_id = null
if( action.snapshot_id ) snapshot_id = action.snapshot_id
var playlist = Object.assign({}, ui.playlist, { tracks: action.tracks, snapshot_id: snapshot_id })
return Object.assign({}, ui, { playlist: playlist });
*/
/**
* Library Playlists