15 lines
513 B
CoffeeScript
Raw Normal View History

2012-08-27 03:53:30 +04:00
class BeatHaven.Views.ArtistShow extends Backbone.View
2012-09-01 21:55:01 +04:00
template: HoganTemplates["backbone/templates/artist/show"]
2012-08-27 03:53:30 +04:00
initialize: ->
@model.on("change", @render, this)
render: ->
2012-09-01 21:55:01 +04:00
if typeof @model.get("artist_bio") != "undefined"
for album_info in @model.get("artist_albums")
for track_info in album_info.album_tracks
track = new BeatHaven.Models.Track(track_info.meta)
BeatHaven.player.tracks.push(track)
$(@el).html(@template.render(@model.toJSON()))
2012-08-27 03:53:30 +04:00
this