From 83ca1fcfb45d5cdedb763d79efc3965747a27652 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 25 Oct 2014 17:45:01 +0200 Subject: [PATCH] Changed notes to be rendered only in image posts --- public_html/js/Presenters/PostContentPresenter.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/public_html/js/Presenters/PostContentPresenter.js b/public_html/js/Presenters/PostContentPresenter.js index 217e08e6..a3978c17 100644 --- a/public_html/js/Presenters/PostContentPresenter.js +++ b/public_html/js/Presenters/PostContentPresenter.js @@ -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 {