From 4a04a1129fffd1e128e53ba7886777c8d7b36b55 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 5 Nov 2015 01:02:20 -0500 Subject: populate product view --- StoneIsland/www/js/lib/blogs/StoryView.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'StoneIsland/www/js/lib/blogs/StoryView.js') diff --git a/StoneIsland/www/js/lib/blogs/StoryView.js b/StoneIsland/www/js/lib/blogs/StoryView.js index b47b0488..efdd65a7 100644 --- a/StoneIsland/www/js/lib/blogs/StoryView.js +++ b/StoneIsland/www/js/lib/blogs/StoryView.js @@ -4,6 +4,7 @@ var StoryView = View.extend({ template: $("#story .template").html(), events: { + "load img": "image_loaded" }, initialize: function(){ @@ -20,13 +21,17 @@ var StoryView = View.extend({ this.data = data this.$loader.hide() this.$content.empty() + // id title image[uri caption] body this.data.forEach(function(row){ - var t = this.template.replace(/{{image}}/, row.image.url) + var t = this.template.replace(/{{image}}/, row.image.uri) .replace(/{{date}}/, row.date) .replace(/{{title}}/, row.title) - .replace(/{{body}}/, row.body) + .replace(/{{body}}/, row.body.replace(/\n/g, "
")) this.$content.append(t) }.bind(this)) }, + + image_loaded: function(){ + }, }) \ No newline at end of file -- cgit v1.2.3-70-g09d2