Context menu on local material; Passes full item object; Shift + click when nothing selected

This commit is contained in:
James Barnsley
2017-02-02 09:06:15 +13:00
parent 902b9cf58c
commit c0633ad409
9 changed files with 86 additions and 34 deletions

View File

@ -21,10 +21,14 @@ class LibraryArtists extends React.Component{
super(props);
}
handleContextMenu(e,uri){
e.preventDefault()
var data = { uris: [uri] }
this.props.uiActions.showContextMenu( e, data, 'artist', 'click' )
handleContextMenu(e,item){
var data = {
e: e,
context: 'artist',
uris: [item.uri],
item: item
}
this.props.uiActions.showContextMenu(data)
}
componentDidMount(){
@ -68,17 +72,18 @@ class LibraryArtists extends React.Component{
return (
<section className="list-wrapper">
<List
handleContextMenu={(e,uri) => this.handleContextMenu(e,uri)}
handleContextMenu={(e,item) => this.handleContextMenu(e,item)}
rows={artists}
columns={columns}
link_prefix={global.baseURL+"artist/"} show_source_icon={true} />
link_prefix={global.baseURL+"artist/"}
show_source_icon={true} />
</section>
)
}else{
return (
<section className="grid-wrapper">
<ArtistGrid
handleContextMenu={(e,uri) => this.handleContextMenu(e,uri)}
handleContextMenu={(e,item) => this.handleContextMenu(e,item)}
artists={artists} />
</section>
)