summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views
diff options
context:
space:
mode:
authorjulian laplace <julescarbon@gmail.com>2022-10-30 21:03:16 +0100
committerjulian laplace <julescarbon@gmail.com>2022-10-30 21:03:16 +0100
commitbc8e849ad0033f8385c0ff7052a3c44cf1e729b5 (patch)
treefc4dd2920f394b9b02dd1089a8625b6bc1871f27 /public/assets/js/lib/views
parentd2481245a88f189ea0d1b69cc91a684f3e2bb46b (diff)
expand/post icons
Diffstat (limited to 'public/assets/js/lib/views')
-rw-r--r--public/assets/js/lib/views/stream/hootstream.js20
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>&middot;</div>" +
- `<div class="action" data-action="${action}">${label}</div>`
+ ({ action, icon, label }) =>
+ `<div class="action" data-action="${action}" title="${label}">${ICONS[icon]}</div>`
)
.join("");