aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-03-19 17:07:29 +0100
committerdefault <nobody@localhost>2025-03-19 17:07:29 +0100
commit6f310aff4f38679b2f85e1e7e55705e2710e8bcc (patch)
tree0a44bc8b71fee6e0cbb49b5402d77f0569439149 /html.c
parent83c2888a12fb4b3cedff0a8c033532e622f74d8c (diff)
Hide the first child container if it's empty.
Diffstat (limited to 'html.c')
-rw-r--r--html.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/html.c b/html.c
index fe3b4a1..78a9854 100644
--- a/html.c
+++ b/html.c
@@ -2609,6 +2609,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
const char *cmd5;
int cnt = 0;
int o_cnt = 0;
+ int f_cnt = 0;
/* get the first child */
xs_list_next(children, &cmd5, &ctxt);
@@ -2632,6 +2633,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
html_entry(user, f_chd, read_only, level + 1, cmd5, hide_children));
cnt++;
+ f_cnt++;
left--;
}
else
@@ -2680,6 +2682,10 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
if (o_cnt == 0 && ch_older)
xs_html_add(ch_older,
xs_html_attr("style", "display: none"));
+
+ if (f_cnt == 0)
+ xs_html_add(fch_container,
+ xs_html_attr("style", "display: none"));
}
}