From 5d68db92b37545fb03332a46b01d0f1aad8ce64b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 17 Sep 2015 21:26:52 -0400 Subject: populate selector --- StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js') diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js index ed46af31..0f03a518 100644 --- a/StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js @@ -8,13 +8,25 @@ var StoryView = View.extend({ initialize: function(){ this.$content = this.$(".content") + this.$loader = this.$(".loader") + this.scroller = new IScroll('#story .scroll') }, show: function(){ document.body.className = "story" }, - - populate: function(){ + + 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({{date}}, row.date) + .replace({{title}}, row.title) + .replace({{body}}, row.body) + this.$content.append(t) + }.bind(this)) }, }) \ No newline at end of file -- cgit v1.2.3-70-g09d2