var ArchiveView = View.extend({ el: "#archive", template: $("#archive .template").html(), events: { }, initialize: function(){ this.$content = this.$(".content") this.$loader = this.$(".loader") this.scroller = new IScroll('#archive .scroll') }, show: function(){ document.body.className = "archive" }, populate: function(data){ this.data = data this.$loader.hide() this.$content.empty() this.data.forEach(function(row){ var t = this.template.replace(/{{image}}/, row.image.url) .replace(/{{code}}/, row.code) .replace(/{{title}}/, row.title) .replace(/{{body}}/, row.body) this.$content.append(t) }.bind(this)) }, })