Skip to content

Instantly share code, notes, and snippets.

@micheltem
Created February 10, 2014 14:36
Show Gist options
  • Save micheltem/8917022 to your computer and use it in GitHub Desktop.
Save micheltem/8917022 to your computer and use it in GitHub Desktop.
class _app.ListView extends app.MSBaseListView
el: "#body"
template: "script#projects"
views:
"#project-create": new app.Project.CreateView()
events:
"click #add-project": "createProject"
initialize: ->
@childViewClass = app.Project.View
@listEl = "#projects-list"
super
app.on "project:create", =>
_newProjectView = new app.Project.NewView(model: new app.Project.Model())
_newProjectView.render()
@setView "#project-new", _newProjectView
# _newProjectView.model = new app.Project.Model()
_newProjectView.show()
app.on "project:created", (project) =>
_newProjectView.$el.find(".modal").modal("hide")
@collection.add project
@_collectionBinder.on "elCreated", () =>
console.log arguments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment