mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
Also hide Older... posts details if it's empty.
This commit is contained in:
parent
d50b039104
commit
c12acc0cc9
1 changed files with 9 additions and 1 deletions
10
html.c
10
html.c
|
@ -1859,6 +1859,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
|
||||||
xs_list *p = children;
|
xs_list *p = children;
|
||||||
char *cmd5;
|
char *cmd5;
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
|
int o_cnt = 0;
|
||||||
|
|
||||||
while (xs_list_iter(&p, &cmd5)) {
|
while (xs_list_iter(&p, &cmd5)) {
|
||||||
xs *chd = NULL;
|
xs *chd = NULL;
|
||||||
|
@ -1874,9 +1875,12 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
|
||||||
level + 1, cmd5, hide_children);
|
level + 1, cmd5, hide_children);
|
||||||
|
|
||||||
if (che != NULL) {
|
if (che != NULL) {
|
||||||
if (left > 3)
|
if (left > 3) {
|
||||||
xs_html_add(ch_older,
|
xs_html_add(ch_older,
|
||||||
che);
|
che);
|
||||||
|
|
||||||
|
o_cnt++;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
xs_html_add(ch_container,
|
xs_html_add(ch_container,
|
||||||
che);
|
che);
|
||||||
|
@ -1895,6 +1899,10 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
|
||||||
if (cnt == 0)
|
if (cnt == 0)
|
||||||
xs_html_add(ch_details,
|
xs_html_add(ch_details,
|
||||||
xs_html_attr("style", "display: none"));
|
xs_html_attr("style", "display: none"));
|
||||||
|
|
||||||
|
if (o_cnt == 0 && ch_older)
|
||||||
|
xs_html_add(ch_older,
|
||||||
|
xs_html_attr("style", "display: none"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue