Skip to content

Instantly share code, notes, and snippets.

@jrf0110
Created September 28, 2012 21:52
Show Gist options
  • Save jrf0110/3802265 to your computer and use it in GitHub Desktop.
Save jrf0110/3802265 to your computer and use it in GitHub Desktop.
View Org
var AppView = Backbone.View.extend({
initialize: function(){
this.children = {
header: new Views.Header()
, content: new Views.Content({ model: this.currentPage })
, footer: new Views.Footer()
};
}
, render: function(){
var fragment = document.createDocumentFragment();
for (var child in this.children){
this.children[child].render()
fragment.appendChild(this.children[child].el);
}
this.el.innerHTML = "";
this.el.appendChild(fragment);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment