Context touch
This commit is contained in:
@ -14,22 +14,31 @@ class ContextMenu extends React.Component{
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
//this.handleScroll = this.handleScroll.bind(this);
|
||||
this.handleScroll = this.handleScroll.bind(this)
|
||||
this.handleClick = this.handleClick.bind(this)
|
||||
}
|
||||
/*
|
||||
|
||||
componentDidMount(){
|
||||
window.addEventListener("scroll", this.handleScroll, false);
|
||||
window.addEventListener("scroll", this.handleScroll, false)
|
||||
window.addEventListener("click", this.handleClick, false)
|
||||
}
|
||||
|
||||
componentWillUnmount(){
|
||||
window.removeEventListener("scroll", this.handleScroll, false);
|
||||
window.removeEventListener("scroll", this.handleScroll, false)
|
||||
window.removeEventListener("click", this.handleClick, false)
|
||||
}
|
||||
|
||||
handleScroll(){
|
||||
if( this.props.context_menu.show ){
|
||||
if( this.props.context_menu.show && this.props.context_menu.trigger == 'click' ){
|
||||
this.props.uiActions.hideContextMenu();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
handleClick(){
|
||||
if( this.props.context_menu.show && this.props.context_menu.trigger == 'click' ){
|
||||
this.props.uiActions.hideContextMenu();
|
||||
}
|
||||
}
|
||||
|
||||
playQueueItem(){
|
||||
var selectedTracks = this.props.context_menu.data.selected_tracks;
|
||||
@ -191,7 +200,7 @@ class ContextMenu extends React.Component{
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="context-menu" style={style}>
|
||||
<div className={ this.props.context_menu.trigger+" context-menu"} style={style}>
|
||||
{ this.renderItems() }
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -81,7 +81,7 @@ class TrackList extends React.Component{
|
||||
selected_tracks: selected_tracks,
|
||||
selected_tracks_indexes: this.tracksIndexes( selected_tracks )
|
||||
}
|
||||
this.props.uiActions.showContextMenu( e, this.props.context, data )
|
||||
this.props.uiActions.showContextMenu( e, data, this.props.context, 'touch' )
|
||||
}else{
|
||||
this.props.uiActions.hideContextMenu()
|
||||
}
|
||||
@ -136,7 +136,7 @@ class TrackList extends React.Component{
|
||||
selected_tracks: selected_tracks,
|
||||
selected_tracks_indexes: this.tracksIndexes( selected_tracks )
|
||||
}
|
||||
this.props.uiActions.showContextMenu( e, this.props.context, data )
|
||||
this.props.uiActions.showContextMenu( e, data, this.props.context, 'click' )
|
||||
}
|
||||
|
||||
toggleTrackSelections(e, index){
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
|
||||
import * as helpers from '../../helpers'
|
||||
|
||||
export function showContextMenu( e, context = false, data ){
|
||||
export function showContextMenu( e, data, context = false, trigger = 'click' ){
|
||||
return {
|
||||
type: 'SHOW_CONTEXT_MENU',
|
||||
position_x: e.clientX,
|
||||
position_y: e.clientY,
|
||||
context: context,
|
||||
trigger: trigger,
|
||||
data: data
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,6 +29,7 @@ export default function reducer(ui = {}, action){
|
||||
position_x: action.position_x,
|
||||
position_y: action.position_y,
|
||||
context: action.context,
|
||||
trigger: action.trigger,
|
||||
data: action.data
|
||||
}
|
||||
});
|
||||
|
||||
@ -60,7 +60,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@include responsive( $bp_medium ){
|
||||
&.touch{
|
||||
|
||||
bottom: 0 !important;
|
||||
left: 0 !important;
|
||||
right: 0 !important;
|
||||
|
||||
Reference in New Issue
Block a user