Skip to content

Commit

Permalink
Merge pull request #389 from indeyets/omitted
Browse files Browse the repository at this point in the history
fix for count of omitted likes
  • Loading branch information
epicmonkey committed May 19, 2015
2 parents 8af0c41 + 2576384 commit 615e60a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions public/js/app/controllers/PostGenericController.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ define(["config",
return this.get('model.likes').isAny('id', this.get('session.currentUser.id'))
}.property('model.likes', 'session.currentUser.id'),

isOmittedComments: function() {
hasOmittedComments: function() {
return this.get('model.omittedComments') > 0
}.property('model.omittedComments'),

Expand All @@ -31,7 +31,7 @@ define(["config",
return this.get('model.omittedComments') + this.get('model.comments.length') - 2
}.property('model.omittedComments', 'model.comments.length'),

isOmittedLikes: function() {
hasOmittedLikes: function() {
return this.get('maxLikes') != 'all' &&
(this.get('model.omittedLikes') != 0 ||
this.get('model.likes.length') > 4)
Expand Down
2 changes: 1 addition & 1 deletion public/js/app/templates/postLikesTemplate.handlebars
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="likes">
<i class="fa fa-heart icon"></i>

{{#if controller.isOmittedLikes}}
{{#if controller.hasOmittedLikes}}
<ul class="p-timeline-user-likes">
{{#each controller.firstLikes as |user index|}}
<li class="p-timeline-user-like">
Expand Down
2 changes: 1 addition & 1 deletion public/js/app/templates/timelinePostTemplate.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</div>

<div class="comments">
{{#if controller.isOmittedComments}}
{{#if controller.hasOmittedComments}}
{{#each comment in controller.firstComments itemController="post-comment"}}
{{view "post-comment" content=comment}}
{{/each}}
Expand Down

0 comments on commit 615e60a

Please sign in to comment.