From 1e745fa64891c4f645902a79edc61c3efe4c18a7 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Tue, 14 Oct 2014 22:55:39 +0200 Subject: [PATCH] Fixed tag edit not rendering example posts --- public_html/js/Presenters/TagPresenter.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public_html/js/Presenters/TagPresenter.js b/public_html/js/Presenters/TagPresenter.js index 06df9cc0..88390209 100644 --- a/public_html/js/Presenters/TagPresenter.js +++ b/public_html/js/Presenters/TagPresenter.js @@ -19,6 +19,7 @@ App.Presenters.TagPresenter = function( var tag; var tagName; + var posts; var privileges = {}; @@ -52,7 +53,7 @@ App.Presenters.TagPresenter = function( api.get('posts', {query: tagName})) .then(function(tagResponse, postsResponse) { tag = tagResponse.json; - var posts = postsResponse.json.data; + posts = postsResponse.json.data; posts = posts.slice(0, 8); render(); @@ -84,7 +85,7 @@ App.Presenters.TagPresenter = function( .then(function(response) { tag = response.json; render(); - router.navigate('#/tag/' + tag.name); + renderPosts(posts); }).fail(function(response) { console.log(response); window.alert('An error occurred');