diff options
Diffstat (limited to 'public')
| -rw-r--r-- | public/assets/js/lib/views/stream/hootstream.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/public/assets/js/lib/views/stream/hootstream.js b/public/assets/js/lib/views/stream/hootstream.js index f987e3f..db646f1 100644 --- a/public/assets/js/lib/views/stream/hootstream.js +++ b/public/assets/js/lib/views/stream/hootstream.js @@ -110,7 +110,7 @@ var HootStream = View.extend({ hoot: hoot || "<div class='hootText'>" + tidy_urls(comment, true) + "</div>", age: get_age(date), - age_opacity: get_age_opacity(date), + age_opacity: className === "first_post" ? 1.0 : get_age_opacity(date), ...options, }); }, @@ -131,10 +131,12 @@ var HootStream = View.extend({ } thread = thread.shift(); console.log(query, thread.id); + const isViewingKeyword = query.keyword === thread.keyword; const isViewingThread = query.thread === thread.id; // console.log(thread, comments, files, images); const postedToday = +new Date() / 1000 - thread.lastmodified < 86400; const age_opacity = get_age_opacity(thread.lastmodified); + console.log(thread); return [ "<div class='divider dark'></div>", this.renderHoot({ @@ -146,15 +148,17 @@ var HootStream = View.extend({ username: thread.username, className: postedToday ? "isRecent" : "", date: thread.lastmodified, - file_count: `${files.length || 0} f.`, - file_opacity: age_opacity * get_size_opacity(files.length), - comment_count: `${comments.length || 0} c.`, - comment_opacity: age_opacity * get_size_opacity(comments.length), + file_count: `${thread.file_count || 0} f.`, + file_opacity: age_opacity * get_size_opacity(thread.file_count), + comment_count: `${thread.comment_count || 0} c.`, + comment_opacity: age_opacity * get_size_opacity(thread.comment_count), }), - this.renderFiles(postedToday ? files : files.slice(0, 10)), + this.renderFiles( + isViewingThread || postedToday ? files : files.slice(0, 10) + ), ...this.renderHoots({ hoots: comments.slice(0, 1).map(trimComment(isViewingThread)), - tag: "first_post", + className: "first_post", }), ...this.renderHoots({ hoots: |
