Further refactoring of the queue controller and view

- Removes queue-related functions from the main controller. They are now handled by queue.js, which delegates them to player-service.js
- Fixes problem in scrobbling. A song is no longer scrobbled every time it is paused. A song will not be scrobbled upon loading, only while it is playing.
- Moves the entire html for the sidebar queue to queue.html. It replaces a template that was no longer used.
- Most queue-related functions in player return player itself to make them chainable just like in jQuery, e.g. : player.shuffleQueue().playFirstSong();
This commit is contained in:
Hyzual 2015-01-03 14:07:22 +01:00
parent 83869b7808
commit c787c468b9
12 changed files with 85 additions and 89 deletions

View file

@ -11,11 +11,13 @@ angular.module('jamstash.queue.controller', ['jamstash.player.service'])
player.play(song);
};
$scope.queueEmpty = function() {
$scope.emptyQueue = function() {
player.emptyQueue();
//TODO: Hyz: Shouldn't it be in a directive ?
$.fancybox.close();
};
$scope.queueShuffle = function() {
$scope.shuffleQueue = function() {
player.shuffleQueue();
};
@ -26,4 +28,8 @@ angular.module('jamstash.queue.controller', ['jamstash.player.service'])
$scope.removeSongFromQueue = function(song) {
player.removeSong(song);
};
$scope.removeSelectedSongsFromQueue = function () {
player.removeSongs($scope.selectedSongs);
};
}]);