Skip to content

Commit

Permalink
Context menu for all lists
Browse files Browse the repository at this point in the history
  • Loading branch information
jaedb committed Nov 17, 2017
1 parent 7ec5a85 commit cffc475
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 30 deletions.
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.0
3.8.0
10 changes: 6 additions & 4 deletions src/js/components/ContextMenuTrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ export default class ContextMenuTrigger extends React.Component{
className += ' '+this.props.className
}
return (
<span className={className} onClick={e => this.props.onTrigger(e)}>
<span className="dot"></span>
<span className="dot"></span>
<span className="dot"></span>
<span className={className}
onMouseDown={e => this.props.onTrigger(e)}
onTouchEnd={e => this.props.onTrigger(e)}>
<span className="dot"></span>
<span className="dot"></span>
<span className="dot"></span>
</span>
);
}
Expand Down
2 changes: 2 additions & 0 deletions src/js/components/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import FontAwesome from 'react-fontawesome'
import ArtistSentence from './ArtistSentence'
import Dater from './Dater'
import URILink from './URILink'
import ContextMenuTrigger from './ContextMenuTrigger'

import * as helpers from '../helpers'
import * as uiActions from '../services/ui/actions'
Expand Down Expand Up @@ -103,6 +104,7 @@ class List extends React.Component{
)
})
}
<ContextMenuTrigger onTrigger={e => this.handleContextMenu(e, row)} />
</div>
)
})
Expand Down
8 changes: 2 additions & 6 deletions src/js/components/Track.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import FontAwesome from 'react-fontawesome'
import ArtistSentence from './ArtistSentence'
import Dater from './Dater'
import URILink from './URILink'
import ContextMenuTrigger from './ContextMenuTrigger'

import * as helpers from '../helpers'

Expand Down Expand Up @@ -227,12 +228,7 @@ export default class Track extends React.Component{
}

track_columns.push(
<span
className="context-zone"
key="context-zone"
onClick={e => this.handleContextMenu(e)}>
<FontAwesome name="ellipsis-h" fixedWidth />
</span>
<ContextMenuTrigger key="context" onTrigger={e => this.handleContextMenu(e)} />
)

if (this.props.mini_zones){
Expand Down
43 changes: 24 additions & 19 deletions src/scss/components/_lists.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

display: block;
position: relative;
padding: 14px 10px 13px;
padding: 14px 30px 13px 10px;
margin: 0 -10px -1px -10px;
cursor: pointer;
border-radius: 3px;
Expand All @@ -39,6 +39,29 @@
display: none;
}

.context-menu-trigger {
position: absolute;
top: 6px;
right: 0;

.dot {
width: 4px;
height: 4px;
margin-left: 0;
}

&:before {
display: none !important;
}
}

.source {
color: $mid_grey;
position: absolute;
top: 16px;
right: 32px;
}

:root .notouch:not(.dragging) &:not(.header):not(.no-click).hover {
background: rgba(255,255,255,0.03);
cursor: pointer;
Expand Down Expand Up @@ -85,24 +108,6 @@
margin-top: -3px;
background: transparent;
}

.source {
color: $mid_grey;
position: absolute;
top: 16px;
right: 32px;
}

.context-zone {
position: absolute;
top: 12px;
right: 4px;
padding: 4px;

.fa {
font-size: 16px;
}
}
}
}

Expand Down

0 comments on commit cffc475

Please sign in to comment.