From 5394dbc3d2d52bef5ec20ba0abeea85c8c230878 Mon Sep 17 00:00:00 2001 From: evazion Date: Sat, 7 Dec 2019 18:36:55 -0600 Subject: [PATCH] tagging: lower happy/sad tag count thresholds. Lower the frowny face tag threshold from 25 to 10 tags and the happy face tag threshold from 35 to 20 tags. --- app/javascript/src/javascripts/posts.js.erb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/javascript/src/javascripts/posts.js.erb b/app/javascript/src/javascripts/posts.js.erb index faac75e0c..e252d29fc 100644 --- a/app/javascript/src/javascripts/posts.js.erb +++ b/app/javascript/src/javascripts/posts.js.erb @@ -10,6 +10,8 @@ Post.pending_update_count = 0; Post.SWIPE_THRESHOLD = 60; Post.SWIPE_VELOCITY = 0.6; Post.MAX_RECOMMENDATIONS = 45; // 3 rows of 9 posts at 1920x1080. +Post.LOW_TAG_COUNT = 10; +Post.HIGH_TAG_COUNT = 20; Post.initialize_all = function() { @@ -605,13 +607,18 @@ Post.update_tag_count = function(event) { string = (count === 1) ? (count + " tag") : (count + " tags") } } + $("#tags-container .count").html(string); - let klass = "smile"; - if (count < 25) { + let klass = ""; + + if (count < Post.LOW_TAG_COUNT) { klass = "frown"; - } else if (count < 35) { + } else if (count >= Post.LOW_TAG_COUNT && count < Post.HIGH_TAG_COUNT) { klass = "meh"; + } else { + klass = "smile"; } + $("#tags-container .options #face").removeClass().addClass(`far fa-${klass}`); }