mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 09:37:17 +00:00
Fake "New List" option by just removing all tracks from the current list
This commit is contained in:
parent
7e7e217075
commit
353b0b909c
3 changed files with 17 additions and 9 deletions
|
|
@ -36,6 +36,7 @@ import {
|
|||
TOGGLE_EQUALIZER_SHADE_MODE,
|
||||
CLOSE_EQUALIZER_WINDOW,
|
||||
REMOVE_TRACKS,
|
||||
REMOVE_ALL_TRACKS,
|
||||
PLAY,
|
||||
PAUSE,
|
||||
REVERSE_LIST,
|
||||
|
|
@ -343,6 +344,10 @@ export function removeSelectedTracks() {
|
|||
};
|
||||
}
|
||||
|
||||
export function removeAllTracks() {
|
||||
return { type: REMOVE_ALL_TRACKS };
|
||||
}
|
||||
|
||||
export function reverseList() {
|
||||
return { type: REVERSE_LIST };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { removeAllTracks } from "../../actionCreators";
|
||||
import PlaylistMenu from "./PlaylistMenu";
|
||||
|
||||
/* eslint-disable no-alert */
|
||||
|
||||
const ListMenu = () => (
|
||||
const ListMenu = props => (
|
||||
<PlaylistMenu id="playlist-list-menu">
|
||||
<div
|
||||
className="new-list"
|
||||
onClick={() => alert("Not supported in Winamp2-js")}
|
||||
/>
|
||||
<div className="new-list" onClick={props.removeAllTracks} />
|
||||
<div
|
||||
className="save-list"
|
||||
onClick={() => alert("Not supported in Winamp2-js")}
|
||||
|
|
@ -21,5 +19,7 @@ const ListMenu = () => (
|
|||
</PlaylistMenu>
|
||||
);
|
||||
|
||||
const mapDispatchToProps = {};
|
||||
const mapDispatchToProps = {
|
||||
removeAllTracks
|
||||
};
|
||||
export default connect(null, mapDispatchToProps)(ListMenu);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { REMOVE_ALL_TRACKS } from "../../actionTypes";
|
||||
import { cropPlaylist, removeSelectedTracks } from "../../actionCreators";
|
||||
import {
|
||||
cropPlaylist,
|
||||
removeSelectedTracks,
|
||||
removeAllTracks
|
||||
} from "../../actionCreators";
|
||||
import PlaylistMenu from "./PlaylistMenu";
|
||||
|
||||
/* eslint-disable no-alert */
|
||||
|
|
@ -20,7 +23,7 @@ const RemoveMenu = props => (
|
|||
|
||||
const mapDispatchToProps = {
|
||||
removeSelected: removeSelectedTracks,
|
||||
removeAll: () => ({ type: REMOVE_ALL_TRACKS }),
|
||||
removeAll: removeAllTracks,
|
||||
crop: cropPlaylist
|
||||
};
|
||||
export default connect(null, mapDispatchToProps)(RemoveMenu);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue