This is an automated email from the ASF dual-hosted git repository. humbedooh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
commit 09b674f9f011c5d05d43fb59cff8fb86550bdba2 Author: Daniel Gruno <[email protected]> AuthorDate: Thu Oct 28 23:26:14 2021 +0200 move sub button up so it'll always render if applicable --- webui/js/ponymail.js | 22 ++++++++++++---------- webui/js/source/sidebar-stats.js | 22 ++++++++++++---------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js index 54b0368..cfdb13d 100644 --- a/webui/js/ponymail.js +++ b/webui/js/ponymail.js @@ -4155,6 +4155,18 @@ async function sidebar_stats(json) { obj.innerHTML = ""; // clear stats bar + // Subscribe button + if (prefs && prefs.subscribeLinks) { + let sb = document.getElementById('sidebar_subscribe'); + if (sb) sb.textContent = ""; + if (sb && json.list && !json.list.match(/\*/)) { + sb.textContent = ""; + let sublink = json.list.replace("@", "-subscribe@"); + let subbutton = new HTML("a", {href: `mailto:${sublink}`, id: "subscribe_button"}, "Subscribe to list"); + sb.inject(subbutton); + } + } + if (!json.emails || isHash(json.emails) || json.emails.length == 0) { obj.innerText = "No emails found..."; return; @@ -4200,14 +4212,4 @@ async function sidebar_stats(json) { }, 50); } - // Subscribe button - if (prefs && prefs.subscribeLinks) { - let sb = document.getElementById('sidebar_subscribe'); - if (sb && json.list) { - sb.textContent = ""; - let sublink = json.list.replace("@", "-subscribe@"); - let subbutton = new HTML("a", {href: `mailto:${sublink}`, id: "subscribe_button"}, "Subscribe to list"); - sb.inject(subbutton); - } - } } \ No newline at end of file diff --git a/webui/js/source/sidebar-stats.js b/webui/js/source/sidebar-stats.js index 31dcb06..d1605d6 100644 --- a/webui/js/source/sidebar-stats.js +++ b/webui/js/source/sidebar-stats.js @@ -23,6 +23,18 @@ async function sidebar_stats(json) { obj.innerHTML = ""; // clear stats bar + // Subscribe button + if (prefs && prefs.subscribeLinks) { + let sb = document.getElementById('sidebar_subscribe'); + if (sb) sb.textContent = ""; + if (sb && json.list && !json.list.match(/\*/)) { + sb.textContent = ""; + let sublink = json.list.replace("@", "-subscribe@"); + let subbutton = new HTML("a", {href: `mailto:${sublink}`, id: "subscribe_button"}, "Subscribe to list"); + sb.inject(subbutton); + } + } + if (!json.emails || isHash(json.emails) || json.emails.length == 0) { obj.innerText = "No emails found..."; return; @@ -68,14 +80,4 @@ async function sidebar_stats(json) { }, 50); } - // Subscribe button - if (prefs && prefs.subscribeLinks) { - let sb = document.getElementById('sidebar_subscribe'); - if (sb && json.list) { - sb.textContent = ""; - let sublink = json.list.replace("@", "-subscribe@"); - let subbutton = new HTML("a", {href: `mailto:${sublink}`, id: "subscribe_button"}, "Subscribe to list"); - sb.inject(subbutton); - } - } } \ No newline at end of file
