mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: Only show like heat map when there are 10 posts
This commit is contained in:
parent
fcbab8e9b0
commit
914bbd2a7b
1 changed files with 4 additions and 2 deletions
|
@ -109,8 +109,10 @@ Discourse.Topic = Discourse.Model.extend({
|
|||
|
||||
likesHeat: function() {
|
||||
var likes = parseFloat(this.get('like_count')),
|
||||
posts = parseFloat(this.get('posts_count')),
|
||||
ratio = (likes || 0) / (posts || 1);
|
||||
posts = parseFloat(this.get('posts_count'));
|
||||
|
||||
if (posts < 10) { return; }
|
||||
var ratio = (likes || 0) / posts;
|
||||
|
||||
if (ratio > 2.0) { return 'heatmap-high'; }
|
||||
if (ratio > 1.0) { return 'heatmap-med'; }
|
||||
|
|
Loading…
Reference in a new issue