Slim mode global variable removal
This commit is contained in:
@ -9,7 +9,7 @@ export default class FilterField extends React.Component{
|
||||
super(props)
|
||||
this.state = {
|
||||
value: '',
|
||||
active: (global.slim_mode ? true : false)
|
||||
active: (this.props.slim_mode ? true : false)
|
||||
}
|
||||
|
||||
this.handleKeyUp = this.handleKeyUp.bind(this)
|
||||
@ -24,7 +24,7 @@ export default class FilterField extends React.Component{
|
||||
}
|
||||
|
||||
handleKeyUp(e){
|
||||
if (e.keyCode == 27 && !global.slim_mode){
|
||||
if (e.keyCode == 27 && !this.props.slim_mode){
|
||||
e.preventDefault()
|
||||
|
||||
this.setState({
|
||||
@ -43,13 +43,13 @@ export default class FilterField extends React.Component{
|
||||
handleChange(value){
|
||||
this.setState({
|
||||
value: value,
|
||||
active: (global.slim_mode ? true : (value != ''))
|
||||
active: (this.props.slim_mode ? true : (value != ''))
|
||||
})
|
||||
this.props.handleChange(value)
|
||||
}
|
||||
|
||||
handleBlur(){
|
||||
if (this.state.value == '' && !global.slim_mode){
|
||||
if (this.state.value == '' && !this.props.slim_mode){
|
||||
this.setState({active: false})
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,7 +214,7 @@ export default class Track extends React.Component{
|
||||
)
|
||||
}
|
||||
|
||||
if (global.slim_mode){
|
||||
if (this.props.slim_mode){
|
||||
|
||||
// Select zone handles selection events only
|
||||
// We use onClick to capture touch as well as mouse events in one tidy parcel
|
||||
|
||||
@ -191,7 +191,7 @@ class TrackList extends React.Component{
|
||||
handleSelection(e,track_key){
|
||||
let selected_tracks = this.props.selected_tracks
|
||||
|
||||
if (e.ctrlKey || global.slim_mode){
|
||||
if (e.ctrlKey || this.props.slim_mode){
|
||||
|
||||
// Already selected, so unselect it
|
||||
if (selected_tracks.includes(track_key)){
|
||||
@ -395,6 +395,7 @@ class TrackList extends React.Component{
|
||||
<Track
|
||||
show_source_icon={this.props.show_source_icon}
|
||||
key={track_key}
|
||||
slim_mode={this.props.slim_mode}
|
||||
track={track}
|
||||
context={this.props.context}
|
||||
can_sort={this.props.context == 'queue' || this.props.context == 'editable-playlist'}
|
||||
@ -426,6 +427,7 @@ class TrackList extends React.Component{
|
||||
|
||||
const mapStateToProps = (state, ownProps) => {
|
||||
return {
|
||||
slim_mode: state.ui.slim_mode,
|
||||
selected_tracks: state.ui.selected_tracks,
|
||||
dragger: state.ui.dragger,
|
||||
current_track: state.core.current_track,
|
||||
|
||||
Reference in New Issue
Block a user