Implement playlist's "close" button

This commit is contained in:
Jordan Eldredge 2017-11-16 22:33:59 -08:00
parent 7ae4b7bec6
commit 11a11dfd2b
4 changed files with 19 additions and 4 deletions

View file

@ -229,3 +229,11 @@
height: 20px;
width: 20px;
}
#winamp2-js #playlist-window #playlist-close {
position: absolute;
right: 2px;
height: 9px;
width: 9px;
top: 3px;
}

View file

@ -16,6 +16,7 @@ import {
PLAYLIST_RESIZE_SEGMENT_HEIGHT
} from "../../constants";
import {
TOGGLE_PLAYLIST_WINDOW,
SET_FOCUSED_WINDOW,
SET_PLAYLIST_SCROLL_POSITION
} from "../../actionTypes";
@ -38,7 +39,8 @@ const PlaylistWindow = props => {
playlistScrollPosition,
setPlaylistScrollPosition,
trackOrder,
playlistSize
playlistSize,
close
} = props;
const style = {
@ -80,7 +82,9 @@ const PlaylistWindow = props => {
<div className="playlist-top draggable">
<div className="playlist-top-left draggable" />
<div className="playlist-top-title draggable" />
<div className="playlist-top-right draggable" />
<div className="playlist-top-right draggable">
<div id="playlist-close" onClick={close} />
</div>
</div>
<div className="playlist-middle draggable">
<div className="playlist-middle-left draggable" />
@ -146,7 +150,8 @@ const mapDispatchToProps = (dispatch, ownProps) => ({
stop: () => dispatch(stop()),
openFileDialog: () => dispatch(openFileDialog(ownProps.fileInput)),
setPlaylistScrollPosition: position =>
dispatch({ type: SET_PLAYLIST_SCROLL_POSITION, position: 100 - position })
dispatch({ type: SET_PLAYLIST_SCROLL_POSITION, position: 100 - position }),
close: () => dispatch({ type: TOGGLE_PLAYLIST_WINDOW })
});
const mapStateToProps = state => {

View file

@ -97,6 +97,7 @@ export const imageSelectors = {
],
PLAYLIST_SELECT_ALL: ["#playlist-selection-menu .select-all"],
PLAYLIST_SELECT_ALL_SELECTED: ["#playlist-selection-menu .hover .select-all"],
PLAYLIST_CLOSE_SELECTED: ["#playlist-close:active"],
EQ_WINDOW_BACKGROUND: ["#equalizer-window:not(.shade)"],
EQ_TITLE_BAR: [".equalizer-top"],

View file

@ -344,7 +344,8 @@ export default {
{ name: "PLAYLIST_REMOVE_MENU_BAR", x: 100, y: 111, width: 3, height: 72 },
{ name: "PLAYLIST_SELECT_MENU_BAR", x: 150, y: 111, width: 3, height: 54 },
{ name: "PLAYLIST_MISC_MENU_BAR", x: 200, y: 111, width: 3, height: 54 },
{ name: "PLAYLIST_LIST_BAR", x: 250, y: 111, width: 3, height: 54 }
{ name: "PLAYLIST_LIST_BAR", x: 250, y: 111, width: 3, height: 54 },
{ name: "PLAYLIST_CLOSE_SELECTED", x: 52, y: 42, width: 9, height: 9 }
],
EQ_EX: [
{