var ArchiveView = ScrollableView.extend({ el: "#archive", template: $("#archive .template").html(), events: { }, initialize: function(){ this.$content = this.$(".content") this.$loader = this.$(".loader") this.scroller = new IScroll('#archive', app.iscroll_options) }, show: function(){ this.deferScrollToTop() app.footer.hide() document.body.className = "archive" }, populate: function(data){ this.data = data this.$loader.hide() this.$content.empty() // id title images[ uri label code caption ] this.data.forEach(function(row){ var t = this.template.replace(/{{image}}/, row.images[0].uri) .replace(/{{code}}/, row.code) .replace(/{{title}}/, row.title) this.$content.append(t) }.bind(this)) }, })