Moving track selection to store

This commit is contained in:
James Barnsley
2017-07-21 22:56:28 +12:00
parent 48ca469ce1
commit 52ce953c29
6 changed files with 132 additions and 126 deletions

View File

@ -21,6 +21,16 @@ export function getBroadcasts(){
}
}
export function setSelectedTracks(keys = []){
if (typeof(keys) === 'string'){
keys = [keys]
}
return {
type: 'SET_SELECTED_TRACKS',
keys: keys
}
}
export function showContextMenu(data){
data.position_x = data.e.clientX
data.position_y = data.e.clientY

View File

@ -24,6 +24,9 @@ export default function reducer(ui = {}, action){
if( typeof(action.new_state) !== 'undefined' ) new_state = action.new_state
return Object.assign({}, ui, { sidebar_open : new_state })
case 'SET_SELECTED_TRACKS':
return Object.assign({}, ui, { selected_tracks : Object.assign([],action.keys) })
/**
* Context menu