diff --git a/web/templates/account/dashboard.html b/web/templates/account/dashboard.html index 84ffee1..2cec78c 100644 --- a/web/templates/account/dashboard.html +++ b/web/templates/account/dashboard.html @@ -666,19 +666,21 @@ {{if or (eq .Type "also_posted") (eq .Type "also_comment")}} - + Mute this thread {{else if eq .Type "new_photo"}} - + Mute these notifications @@ -854,13 +856,30 @@ document.addEventListener('DOMContentLoaded', () => { window.alert(resp); }).finally(() => { busy = false; - if (href !== undefined) { + if (href !== undefined && href !== "#") { window.location.href = href; } }); }) }); }); + + // "Mute notification" links. + // NOTE: to avoid conflict with the "mark notification as read, then follow href" code + // above, the mute buttons href is made safer and this function will get its follow-thru + // URL from a data attribute. + (document.querySelectorAll(".nonshy-mute-notification-link") || []).forEach(node => { + node.addEventListener("click", (e) => { + e.preventDefault(); + e.stopPropagation(); + + const link = node.dataset.link, + prompt = node.dataset.confirm; + if (!window.confirm(prompt)) return; + + window.location = link; + }); + }); }); {{end}}