When shuffling the playing queue, the currently playing song will always stay at the first position.

So that we don't end up at the end of the queue after we shuffle it.

- The queue controller will also scroll the queue up to the first element so the user notices the playing song stayed first
This commit is contained in:
Hyzual 2015-03-30 22:31:57 +02:00
parent 9fbd7bcf8e
commit 86eaea4b0e
4 changed files with 37 additions and 6 deletions

View file

@ -16,21 +16,23 @@ angular.module('jamstash.queue.controller', ['jamstash.player.service'])
player.play(song);
};
$scope.emptyQueue = function() {
$scope.emptyQueue = function () {
player.emptyQueue();
//TODO: Hyz: Shouldn't it be in a directive ?
$.fancybox.close();
};
$scope.shuffleQueue = function() {
$scope.shuffleQueue = function () {
player.shuffleQueue();
//TODO: Hyz: Shouldn't it be in a directive ?
$('#SideBar').stop().scrollTo('.header', 400);
};
$scope.addSongToQueue = function(song) {
$scope.addSongToQueue = function (song) {
player.addSong(song);
};
$scope.removeSongFromQueue = function(song) {
$scope.removeSongFromQueue = function (song) {
player.removeSong(song);
};