Add an icon to select all songs in the queue.

Fixes tsquillario/Jamstash#220
This commit is contained in:
Hyzual 2015-10-26 22:57:52 +01:00
parent c758df2ac9
commit cc20a73efa
5 changed files with 98 additions and 6 deletions

View file

@ -36,12 +36,13 @@ function QueueController(
var self = this;
_.extend(self, {
player: player,
player : player,
emptyQueue : emptyQueue,
isPlayingSong : isPlayingSong,
playSong : player.play,
removeSelectedSongsFromQueue: removeSelectedSongsFromQueue,
removeSongFromQueue : player.removeSong,
selectAll : selectAll,
shuffleQueue : shuffleQueue,
toggleSelection : SelectedSongs.toggle,
toggleStar : toggleStar
@ -53,6 +54,15 @@ function QueueController(
$.fancybox.close();
}
function selectAll() {
var allSelected = _.every(player.queue, 'selected');
if (allSelected) {
SelectedSongs.reset();
} else {
SelectedSongs.addSongs(player.queue);
}
}
function isPlayingSong(song) {
return angular.equals(song, player.getPlayingSong());
}