Created
September 28, 2012 21:52
-
-
Save jrf0110/3802265 to your computer and use it in GitHub Desktop.
View Org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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