Changed notes to be rendered only in image posts

This commit is contained in:
Marcin Kurczewski 2014-10-25 17:45:01 +02:00
parent 22d7ab8732
commit 83ca1fcfb4

View file

@ -20,11 +20,6 @@ App.Presenters.PostContentPresenter = function(
templates.postContent = postContentTemplate;
render();
loaded();
presenterManager.initPresenters([
[postNotesPresenter, {post: post, notes: post.notes, $target: $target.find('.post-notes-target')}]],
function() {});
}).fail(function() {
console.log(arguments);
loaded();
@ -33,6 +28,16 @@ App.Presenters.PostContentPresenter = function(
function render() {
$target.html(templates.postContent({post: post}));
if (post.contentType === 'image') {
loadPostNotes();
}
}
function loadPostNotes() {
presenterManager.initPresenters([
[postNotesPresenter, {post: post, notes: post.notes, $target: $target.find('.post-notes-target')}]],
function() {});
}
return {