diff options
| author | julian laplace <julescarbon@gmail.com> | 2022-10-30 21:03:16 +0100 |
|---|---|---|
| committer | julian laplace <julescarbon@gmail.com> | 2022-10-30 21:03:16 +0100 |
| commit | bc8e849ad0033f8385c0ff7052a3c44cf1e729b5 (patch) | |
| tree | fc4dd2920f394b9b02dd1089a8625b6bc1871f27 /public/assets/js/lib/views/stream | |
| parent | d2481245a88f189ea0d1b69cc91a684f3e2bb46b (diff) | |
expand/post icons
Diffstat (limited to 'public/assets/js/lib/views/stream')
| -rw-r--r-- | public/assets/js/lib/views/stream/hootstream.js | 20 |
1 files changed, 14 insertions, 6 deletions
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 }) => - "<div>·</div>" + - `<div class="action" data-action="${action}">${label}</div>` + ({ action, icon, label }) => + `<div class="action" data-action="${action}" title="${label}">${ICONS[icon]}</div>` ) .join(""); |
