Context menu on local material; Passes full item object; Shift + click when nothing selected
This commit is contained in:
@ -6,6 +6,7 @@ import { bindActionCreators } from 'redux'
|
||||
import Header from '../../components/Header'
|
||||
import List from '../../components/List'
|
||||
|
||||
import * as uiActions from '../../services/ui/actions'
|
||||
import * as mopidyActions from '../../services/mopidy/actions'
|
||||
import * as spotifyActions from '../../services/spotify/actions'
|
||||
|
||||
@ -26,6 +27,16 @@ class LibraryLocalArtists extends React.Component{
|
||||
}
|
||||
}
|
||||
|
||||
handleContextMenu(e,item){
|
||||
var data = {
|
||||
e: e,
|
||||
context: 'artist',
|
||||
uris: [item.uri],
|
||||
item: item
|
||||
}
|
||||
this.props.uiActions.showContextMenu(data)
|
||||
}
|
||||
|
||||
loadArtists(props = this.props){
|
||||
if( props.mopidy_connected && !props.local_artists ){
|
||||
this.props.mopidyActions.getLibraryArtists();
|
||||
@ -47,7 +58,12 @@ class LibraryLocalArtists extends React.Component{
|
||||
<div className="view library-local-view">
|
||||
<Header icon="music" title="Local artists" />
|
||||
<section className="list-wrapper">
|
||||
<List columns={[{ name: 'name', width: '100'}]} rows={artists} link_prefix={global.baseURL+"artist/"} />
|
||||
<List
|
||||
columns={[{ name: 'name', width: '100'}]}
|
||||
rows={artists}
|
||||
link_prefix={global.baseURL+"artist/"}
|
||||
handleContextMenu={(e,item) => this.handleContextMenu(e,item)}
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
);
|
||||
@ -71,6 +87,7 @@ const mapStateToProps = (state, ownProps) => {
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
uiActions: bindActionCreators(uiActions, dispatch),
|
||||
mopidyActions: bindActionCreators(mopidyActions, dispatch),
|
||||
spotifyActions: bindActionCreators(spotifyActions, dispatch)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user