Context menus now at the view level
This commit is contained in:
@ -183,16 +183,16 @@ class LibraryAlbums extends React.Component{
|
||||
}
|
||||
]
|
||||
|
||||
var actions = (
|
||||
var options = (
|
||||
<span>
|
||||
<DropdownField icon="sort" name="Sort" value={this.props.sort} options={sort_options} reverse={this.props.sort_reverse} handleChange={val => this.setSort(val)} />
|
||||
<DropdownField icon="eye" name="View" value={this.props.view} options={view_options} handleChange={val => this.props.uiActions.set({ library_albums_view: val })} />
|
||||
<DropdownField icon="sort" name="Sort" value={this.props.sort} options={sort_options} reverse={this.props.sort_reverse} handleChange={val => {this.setSort(val); this.props.uiActions.hideContextMenu() }} />
|
||||
<DropdownField icon="eye" name="View" value={this.props.view} options={view_options} handleChange={val => {this.props.uiActions.set({ library_albums_view: val }); this.props.uiActions.hideContextMenu() }} />
|
||||
</span>
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="view library-albums-view">
|
||||
<Header icon="cd" title="My albums" actions={actions} />
|
||||
<Header icon="cd" title="My albums" options={options} uiActions={this.props.uiActions} />
|
||||
{ this.renderView(albums) }
|
||||
<LazyLoadListener enabled={this.props.library_albums_more} loadMore={ () => this.loadMore() }/>
|
||||
</div>
|
||||
|
||||
@ -75,8 +75,7 @@ class LibraryArtists extends React.Component{
|
||||
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/"} />
|
||||
</section>
|
||||
)
|
||||
}else{
|
||||
@ -132,16 +131,16 @@ class LibraryArtists extends React.Component{
|
||||
}
|
||||
]
|
||||
|
||||
var actions = (
|
||||
var options = (
|
||||
<span>
|
||||
<DropdownField icon="sort" name="Sort" value={ this.props.sort } options={sort_options} reverse={this.props.sort_reverse} handleChange={ value => this.setSort(value) } />
|
||||
<DropdownField icon="eye" name="View" value={ this.props.view } options={view_options} handleChange={ value => this.props.uiActions.set({ library_artists_view: value }) } />
|
||||
<DropdownField icon="sort" name="Sort" value={ this.props.sort } options={sort_options} reverse={this.props.sort_reverse} handleChange={value => {this.setSort(value); this.props.uiActions.hideContextMenu() }} />
|
||||
<DropdownField icon="eye" name="View" value={ this.props.view } options={view_options} handleChange={value => {this.props.uiActions.set({ library_artists_view: value }); this.props.uiActions.hideContextMenu()}} />
|
||||
</span>
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="view library-artists-view">
|
||||
<Header icon="mic" title="My artists" actions={actions} />
|
||||
<Header icon="mic" title="My artists" options={options} uiActions={this.props.uiActions} />
|
||||
{ this.renderView(artists) }
|
||||
<LazyLoadListener enabled={this.props.library_artists_more} loadMore={ () => this.loadMore() }/>
|
||||
</div>
|
||||
|
||||
@ -141,16 +141,16 @@ class LibraryLocalAlbums extends React.Component{
|
||||
}
|
||||
]
|
||||
|
||||
var actions = (
|
||||
var options = (
|
||||
<span>
|
||||
<DropdownField icon="sort" name="Sort" value={this.props.sort} options={sort_options} reverse={this.props.sort_reverse} handleChange={val => this.setSort(val)} />
|
||||
<DropdownField icon="eye" name="View" value={this.props.view} options={view_options} handleChange={val => this.props.uiActions.set({ library_local_albums_view: val })} />
|
||||
<DropdownField icon="sort" name="Sort" value={this.props.sort} options={sort_options} reverse={this.props.sort_reverse} handleChange={val => {this.setSort(val); this.props.uiActions.hideContextMenu() }} />
|
||||
<DropdownField icon="eye" name="View" value={this.props.view} options={view_options} handleChange={val => {this.props.uiActions.set({ library_local_albums_view: val }); this.props.uiActions.hideContextMenu() }} />
|
||||
</span>
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="view library-local-view">
|
||||
<Header icon="music" title="Local albums" actions={actions} />
|
||||
<Header icon="music" title="Local albums" options={options} uiActions={this.props.uiActions} />
|
||||
{this.renderView(albums)}
|
||||
<LazyLoadListener enabled={(this.moreURIsToLoad().length > 0)} loadMore={ () => this.loadMore() }/>
|
||||
</div>
|
||||
|
||||
@ -71,9 +71,9 @@ class LibraryLocalDirectory extends React.Component{
|
||||
|
||||
var items = this.arrange_directory( this.props.directory )
|
||||
|
||||
var actions = null
|
||||
var options = null
|
||||
if (this.props.params.uri != 'local:directory' ){
|
||||
actions = (
|
||||
options = (
|
||||
<button onClick={ () => window.history.back() }>
|
||||
<FontAwesome name="reply" />
|
||||
Back
|
||||
@ -83,7 +83,7 @@ class LibraryLocalDirectory extends React.Component{
|
||||
|
||||
return (
|
||||
<div className="view library-local-view">
|
||||
<Header icon="music" title="Local files" actions={actions} />
|
||||
<Header icon="music" title="Local files" options={options} uiActions={this.props.uiActions} />
|
||||
<section className="list-wrapper">
|
||||
<List
|
||||
columns={[{ name: 'name', width: '100'}]}
|
||||
|
||||
@ -69,6 +69,11 @@ class LibraryPlaylists extends React.Component{
|
||||
label: 'Owner',
|
||||
name: 'owner'
|
||||
},
|
||||
{
|
||||
width: 10,
|
||||
label: 'Source',
|
||||
name: 'source'
|
||||
},
|
||||
{
|
||||
width: 10,
|
||||
label: 'Tracks',
|
||||
@ -76,7 +81,7 @@ class LibraryPlaylists extends React.Component{
|
||||
},
|
||||
{
|
||||
width: 10,
|
||||
label: 'Can edit',
|
||||
label: 'Editable',
|
||||
name: 'can_edit'
|
||||
}
|
||||
]
|
||||
@ -86,8 +91,7 @@ class LibraryPlaylists extends React.Component{
|
||||
handleContextMenu={(e,item) => this.handleContextMenu(e,item)}
|
||||
rows={playlists}
|
||||
columns={columns}
|
||||
link_prefix={global.baseURL+"playlist/"}
|
||||
show_source_icon={true} />
|
||||
link_prefix={global.baseURL+"playlist/"} />
|
||||
</section>
|
||||
)
|
||||
}else{
|
||||
@ -137,20 +141,20 @@ class LibraryPlaylists extends React.Component{
|
||||
}
|
||||
]
|
||||
|
||||
var actions = (
|
||||
<div>
|
||||
<DropdownField icon="sort" name="Sort" value={this.props.sort} options={sort_options} reverse={this.props.sort_reverse} handleChange={val => this.setSort(val)} />
|
||||
<DropdownField icon="eye" name="View" value={this.props.view} options={view_options} handleChange={val => this.props.uiActions.set({ library_playlists_view: val}) } />
|
||||
var options = (
|
||||
<span>
|
||||
<DropdownField icon="sort" name="Sort" value={this.props.sort} options={sort_options} reverse={this.props.sort_reverse} handleChange={val => {this.setSort(val); this.props.uiActions.hideContextMenu() }} />
|
||||
<DropdownField icon="eye" name="View" value={this.props.view} options={view_options} handleChange={val => {this.props.uiActions.set({ library_playlists_view: val}); this.props.uiActions.hideContextMenu() }} />
|
||||
<button onClick={ () => this.props.uiActions.openModal('create_playlist', {} ) }>
|
||||
<FontAwesome name="plus" />
|
||||
New
|
||||
</button>
|
||||
</div>
|
||||
</span>
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="view library-playlists-view">
|
||||
<Header icon="playlist" title="My playlists" actions={actions} />
|
||||
<Header icon="playlist" title="My playlists" options={options} uiActions={this.props.uiActions} />
|
||||
{ this.renderView() }
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user