mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-30 08:37:59 +01:00
18e41d2af4
Volume Slider Track Uploader Fav list A bunch of other things And stuff.
25 lines
469 B
CoffeeScript
25 lines
469 B
CoffeeScript
angular.module('ponyfm').factory('images', [
|
|
'$rootScope'
|
|
($rootScope) ->
|
|
def = null
|
|
self =
|
|
images: []
|
|
isLoading: true
|
|
refresh: (force) ->
|
|
return def if !force && def
|
|
def = new $.Deferred()
|
|
|
|
self.images = []
|
|
self.isLoading = true
|
|
|
|
$.getJSON('/api/web/images/owned').done (images) -> $rootScope.$apply ->
|
|
self.images = images
|
|
self.isLoading = false
|
|
def.resolve images
|
|
|
|
return def
|
|
|
|
self.refresh()
|
|
return self
|
|
])
|
|
|