diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-20 12:01:29 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-20 12:01:29 -0500 |
| commit | 4b6821cee2b7a35e2124a899a13c7559628f075e (patch) | |
| tree | 6ea48247d64b9530d4fc5e2b02b1cf0abb5a8701 /StoneIsland/www/js/lib/blogs | |
| parent | c270b104afaf2a529f4151daee77737ab1c56eaa (diff) | |
loader and stuff frm last nite
Diffstat (limited to 'StoneIsland/www/js/lib/blogs')
| -rw-r--r-- | StoneIsland/www/js/lib/blogs/StoryView.js | 6 |
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)) |
