From bc8e849ad0033f8385c0ff7052a3c44cf1e729b5 Mon Sep 17 00:00:00 2001 From: julian laplace Date: Sun, 30 Oct 2022 21:03:16 +0100 Subject: expand/post icons --- public/assets/js/lib/views/stream/hootstream.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'public/assets/js/lib') diff --git a/public/assets/js/lib/views/stream/hootstream.js b/public/assets/js/lib/views/stream/hootstream.js index 1ab9725..cd25719 100644 --- a/public/assets/js/lib/views/stream/hootstream.js +++ b/public/assets/js/lib/views/stream/hootstream.js @@ -388,6 +388,10 @@ var HootStream = View.extend({ thread = thread[0]; const isViewingKeyword = query.keyword === thread.keyword; const isViewingThread = query.thread === thread.id; + const isCompleteThread = !!( + thread.file_count === files.length + images.length && + thread.comment_count === comments.length + ); // console.log(thread, comments, files, images); const postedToday = +new Date() / 1000 - thread.lastmodified < 86400; const age_opacity = get_age_opacity(thread.lastmodified); @@ -412,15 +416,19 @@ var HootStream = View.extend({ const sortedFiles = this.sortFiles(files, thread.settings?.sort); const actions = [ - hasAudio && { action: "play", label: "Play music" }, - !isViewingThread && { action: "expand", label: "Expand" }, - { action: "post", label: "Post" }, + hasAudio && { action: "play", label: "play music", icon: "play" }, + !isViewingThread && + !isCompleteThread && { + action: "expand", + label: "expand", + icon: "expand", + }, + { action: "post", label: "post", icon: "edit" }, ] .filter((action) => !!action) .map( - ({ action, label }) => - "
·
" + - `
${label}
` + ({ action, icon, label }) => + `
${ICONS[icon]}
` ) .join(""); -- cgit v1.2.3-70-g09d2