From 09ac96526e567d7765d35bb9a46acc0f5e6835e2 Mon Sep 17 00:00:00 2001 From: Trevor Squillario Date: Sat, 22 Feb 2014 21:30:27 -0500 Subject: [PATCH] Issue #146, #153 --- js/controllers/main.js | 17 ++++++++++++++++- js/partials/songs.html | 7 ++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/js/controllers/main.js b/js/controllers/main.js index d9f9bfb..57486da 100644 --- a/js/controllers/main.js +++ b/js/controllers/main.js @@ -1,5 +1,5 @@ JamStash.controller('AppCtrl', -function AppCtrl($scope, $rootScope, $document, $location, $cookieStore, utils, globals, model, notifications, player) { +function AppCtrl($scope, $rootScope, $document, $window, $location, $cookieStore, utils, globals, model, notifications, player) { $rootScope.settings = globals.settings; $rootScope.song = []; $rootScope.queue = []; @@ -313,6 +313,17 @@ function AppCtrl($scope, $rootScope, $document, $location, $cookieStore, utils, var next = $rootScope.queue[0]; $rootScope.playSong(false, next); }; + $scope.playFrom = function (index) { + var from = $rootScope.song.slice(index,$rootScope.song.length); + angular.forEach(from, function (item, key) { + $scope.selectedSongs.push(item); + item.selected = true; + }); + $rootScope.queue = []; + $scope.addSongsToQueue(); + var next = $rootScope.queue[0]; + $rootScope.playSong(false, next); + }; $scope.selectNone = function () { angular.forEach($rootScope.song, function (item, key) { $scope.selectedSongs = []; @@ -330,6 +341,10 @@ function AppCtrl($scope, $rootScope, $document, $location, $cookieStore, utils, $scope.selectedSongs.length = 0; } }; + $scope.removeSong = function (item) { + var index = $rootScope.song.indexOf(item) + $rootScope.song.splice(index, 1); + } $scope.isActive = function (route) { return route === $location.path(); }; diff --git a/js/partials/songs.html b/js/partials/songs.html index d3eb871..5a3bbc4 100644 --- a/js/partials/songs.html +++ b/js/partials/songs.html @@ -1,8 +1,9 @@ 
  • - - - + + + +