Fixed something

This commit is contained in:
nelsonlaquet 2013-09-01 04:45:45 -05:00
parent a2063c9de1
commit 3c561903c7

View file

@ -1,6 +1,6 @@
angular.module('ponyfm').factory('playlists', [ angular.module('ponyfm').factory('playlists', [
'$rootScope', '$state', '$http' '$rootScope', '$state', '$http', 'auth'
($rootScope, $state, $http) -> ($rootScope, $state, $http, auth) ->
playlistDef = null playlistDef = null
playlists = {} playlists = {}
playlistPages = [] playlistPages = []
@ -49,10 +49,11 @@ angular.module('ponyfm').factory('playlists', [
def def
refresh: () -> refresh: () ->
$.getJSON('/api/web/playlists/pinned') if auth.data.isLogged
.done (playlists) -> $rootScope.$apply -> $.getJSON('/api/web/playlists/pinned')
self.pinnedPlaylists.length = 0 .done (playlists) -> $rootScope.$apply ->
self.pinnedPlaylists.push playlist for playlist in playlists self.pinnedPlaylists.length = 0
self.pinnedPlaylists.push playlist for playlist in playlists
deletePlaylist: (playlist) -> deletePlaylist: (playlist) ->
def = new $.Deferred() def = new $.Deferred()