Pony.fm/resources/assets/scripts/app/controllers/playlist.coffee

22 lines
752 B
CoffeeScript
Raw Normal View History

2015-08-31 17:42:21 +02:00
window.pfm.preloaders['playlist'] = [
2015-10-25 03:35:37 +01:00
'$state', 'playlists'
($state, playlists) ->
playlists.fetch $state.params.id, true
2015-08-31 17:42:21 +02:00
]
angular.module('ponyfm').controller 'playlist', [
2015-10-25 03:35:37 +01:00
'$scope', '$state', 'playlists', '$dialog'
($scope, $state, playlists, $dialog) ->
playlist = null
2015-08-31 17:42:21 +02:00
2015-10-25 03:35:37 +01:00
playlists.fetch($state.params.id).done (playlistResponse) ->
$scope.playlist = playlistResponse
playlist = playlistResponse
2015-08-31 17:42:21 +02:00
2015-10-25 03:35:37 +01:00
$scope.share = () ->
dialog = $dialog.dialog
templateUrl: '/templates/partials/playlist-share-dialog.html',
controller: ['$scope', ($scope) -> $scope.playlist = playlist; $scope.close = () -> dialog.close()]
dialog.open()
]