FIX: Only show like heat map when there are 10 posts
This commit is contained in:
parent
fcbab8e9b0
commit
914bbd2a7b
|
@ -109,8 +109,10 @@ Discourse.Topic = Discourse.Model.extend({
|
||||||
|
|
||||||
likesHeat: function() {
|
likesHeat: function() {
|
||||||
var likes = parseFloat(this.get('like_count')),
|
var likes = parseFloat(this.get('like_count')),
|
||||||
posts = parseFloat(this.get('posts_count')),
|
posts = parseFloat(this.get('posts_count'));
|
||||||
ratio = (likes || 0) / (posts || 1);
|
|
||||||
|
if (posts < 10) { return; }
|
||||||
|
var ratio = (likes || 0) / posts;
|
||||||
|
|
||||||
if (ratio > 2.0) { return 'heatmap-high'; }
|
if (ratio > 2.0) { return 'heatmap-high'; }
|
||||||
if (ratio > 1.0) { return 'heatmap-med'; }
|
if (ratio > 1.0) { return 'heatmap-med'; }
|
||||||
|
|
Loading…
Reference in New Issue