summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2024-03-15 19:20:24 +0100
committerGravatar default2024-03-15 19:20:24 +0100
commitc12acc0cc9a5037570207a84f5eaa5e6c849764c (patch)
tree83c49d972138636f9e010eb86d1e1e6f5c262563
parentSet display to none for children details that are empty. (diff)
downloadsnac2-c12acc0cc9a5037570207a84f5eaa5e6c849764c.tar.gz
snac2-c12acc0cc9a5037570207a84f5eaa5e6c849764c.tar.xz
snac2-c12acc0cc9a5037570207a84f5eaa5e6c849764c.zip
Also hide Older... posts details if it's empty.
-rw-r--r--html.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/html.c b/html.c
index 0669145..57804b9 100644
--- a/html.c
+++ b/html.c
@@ -1859,6 +1859,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
1859 xs_list *p = children; 1859 xs_list *p = children;
1860 char *cmd5; 1860 char *cmd5;
1861 int cnt = 0; 1861 int cnt = 0;
1862 int o_cnt = 0;
1862 1863
1863 while (xs_list_iter(&p, &cmd5)) { 1864 while (xs_list_iter(&p, &cmd5)) {
1864 xs *chd = NULL; 1865 xs *chd = NULL;
@@ -1874,9 +1875,12 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
1874 level + 1, cmd5, hide_children); 1875 level + 1, cmd5, hide_children);
1875 1876
1876 if (che != NULL) { 1877 if (che != NULL) {
1877 if (left > 3) 1878 if (left > 3) {
1878 xs_html_add(ch_older, 1879 xs_html_add(ch_older,
1879 che); 1880 che);
1881
1882 o_cnt++;
1883 }
1880 else 1884 else
1881 xs_html_add(ch_container, 1885 xs_html_add(ch_container,
1882 che); 1886 che);
@@ -1895,6 +1899,10 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
1895 if (cnt == 0) 1899 if (cnt == 0)
1896 xs_html_add(ch_details, 1900 xs_html_add(ch_details,
1897 xs_html_attr("style", "display: none")); 1901 xs_html_attr("style", "display: none"));
1902
1903 if (o_cnt == 0 && ch_older)
1904 xs_html_add(ch_older,
1905 xs_html_attr("style", "display: none"));
1898 } 1906 }
1899 } 1907 }
1900 1908