From 3681c43519003bcc97238cea1be6fb9e51d4938c Mon Sep 17 00:00:00 2001 From: zzz Date: Thu, 24 Apr 2025 13:48:27 -0400 Subject: [PATCH] SusiDNS: Expand add section if destination is set, not hostname because links from the LS page don't have hostname set --- apps/susidns/src/js/messages.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/susidns/src/js/messages.js b/apps/susidns/src/js/messages.js index a5f10b45fb..7ca141ed45 100644 --- a/apps/susidns/src/js/messages.js +++ b/apps/susidns/src/js/messages.js @@ -92,11 +92,18 @@ function initClickables() { clickableHeadline.addEventListener('click', ToggleStoragePathView, true); } - /*If the hostname field is empty, hide the add host form and show it when - the user clicks on the form header.*/ + /* + * If the addressbook isn't empty, + * and the destination field is empty, + * hide the add host form and show it when + * the user clicks on the form header. + * Some of our add-to-addressbook links set + * both hostname and destination, and some + * only set destination. + */ var d = document.getElementById("emptybook"); if (d == null) { - var x = document.getElementsByName("hostname"); + var x = document.getElementsByName("destination"); for (var i = 0; i < x.length; i++) { if (x[i].value == "") { var buttonView = document.getElementById("addnewaddrbutton");