summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/blogs/StoryView.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-20 12:01:29 -0500
committerJules Laplace <jules@okfoc.us>2015-11-20 12:01:29 -0500
commit4b6821cee2b7a35e2124a899a13c7559628f075e (patch)
tree6ea48247d64b9530d4fc5e2b02b1cf0abb5a8701 /StoneIsland/www/js/lib/blogs/StoryView.js
parentc270b104afaf2a529f4151daee77737ab1c56eaa (diff)
loader and stuff frm last nite
Diffstat (limited to 'StoneIsland/www/js/lib/blogs/StoryView.js')
-rw-r--r--StoneIsland/www/js/lib/blogs/StoryView.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/StoneIsland/www/js/lib/blogs/StoryView.js b/StoneIsland/www/js/lib/blogs/StoryView.js
index 70ac061f..84684ff7 100644
--- a/StoneIsland/www/js/lib/blogs/StoryView.js
+++ b/StoneIsland/www/js/lib/blogs/StoryView.js
@@ -1,5 +1,7 @@
var StoryView = ScrollableView.extend({
+ loaded: false,
+
el: "#story",
template: $("#story .template").html(),
@@ -23,19 +25,19 @@ var StoryView = ScrollableView.extend({
},
populate: function(data){
+ if (this.loaded) { console.warn("populate called twice"); return }
+ this.loaded = true
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(/{{id}}/, row.id)
- .replace(/{{title}}/, row.title)
.replace(/{{body}}/, row.body.replace(/\n/g, "<br>"))
var li = document.createElement("li")
li.dataset.id = row.id
li.innerHTML = row.title
this.sections[row.id] = row
- //console.log("ok");
this.$links.append(li)
this.$content.append(t)
}.bind(this))