Changed notes to be rendered only in image posts
This commit is contained in:
parent
22d7ab8732
commit
83ca1fcfb4
1 changed files with 10 additions and 5 deletions
|
@ -20,11 +20,6 @@ App.Presenters.PostContentPresenter = function(
|
||||||
templates.postContent = postContentTemplate;
|
templates.postContent = postContentTemplate;
|
||||||
render();
|
render();
|
||||||
loaded();
|
loaded();
|
||||||
|
|
||||||
presenterManager.initPresenters([
|
|
||||||
[postNotesPresenter, {post: post, notes: post.notes, $target: $target.find('.post-notes-target')}]],
|
|
||||||
function() {});
|
|
||||||
|
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
console.log(arguments);
|
console.log(arguments);
|
||||||
loaded();
|
loaded();
|
||||||
|
@ -33,6 +28,16 @@ App.Presenters.PostContentPresenter = function(
|
||||||
|
|
||||||
function render() {
|
function render() {
|
||||||
$target.html(templates.postContent({post: post}));
|
$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 {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue