Skip to content

Instantly share code, notes, and snippets.

@anathematic
Created June 19, 2013 07:08
Show Gist options
  • Save anathematic/5812216 to your computer and use it in GitHub Desktop.
Save anathematic/5812216 to your computer and use it in GitHub Desktop.
class ACC.Views.EssentialsAssessment.Index extends Backbone.View
template : JST['programs/essentials_assessments/index']
events : =>
"click [role=next]" : "goToX"
initialize : =>
@model.Videos.on 'reset', @loadViews
render : =>
$(@el).html(@template(@model.EssentialsAssessment.first().toJSON()))
@loadViews()
@
loadViews : =>
console.log($(@el).find("#videoWrapper"))
view = new ACC.Views.VideosIndex({model: @model})
$(@el).find("#videoWrapper").html(view.render().el)
goToX : (event) =>
event.preventDefault()
href = $(event.currentTarget).attr("href")
ACC.Routers.ServiceUser.navigate href, true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment