From e9f638a888752ae6612ea32258b4542dcb40f2a2 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Tue, 17 May 2022 16:33:44 -0300 Subject: [PATCH] Keep field values when deleting + Fix typo Signed-off-by: RD WebDesign --- scripts/pi-hole/js/customcname.js | 4 ---- scripts/pi-hole/js/customdns.js | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/scripts/pi-hole/js/customcname.js b/scripts/pi-hole/js/customcname.js index e78e4a7e..e0f31760 100644 --- a/scripts/pi-hole/js/customcname.js +++ b/scripts/pi-hole/js/customcname.js @@ -124,10 +124,6 @@ function deleteCustomCNAME() { "Custom CNAME deleted", domain + ": " + target ); - - // Clean up field values and reload table data - $("#domain").val(""); - $("#target").val(""); table.ajax.reload(); } else { utils.showAlert("error", "fas fa-times", "Failure! Something went wrong", response.message); diff --git a/scripts/pi-hole/js/customdns.js b/scripts/pi-hole/js/customdns.js index 865f54b0..b8782883 100644 --- a/scripts/pi-hole/js/customdns.js +++ b/scripts/pi-hole/js/customdns.js @@ -84,7 +84,7 @@ function addCustomDNS() { // Clean up field values and reload table data $("#domain").val(""); - $("#id").val(""); + $("#ip").val(""); table.ajax.reload(); } else { utils.showAlert("error", "fas fa-times", "Failure! Something went wrong", response.message); @@ -113,10 +113,6 @@ function deleteCustomDNS() { utils.enableAll(); if (response.success) { utils.showAlert("success", "far fa-check-circle", "Custom DNS deleted", domain + ": " + ip); - - // Clean up field values and reload table data - $("#domain").val(""); - $("#id").val(""); table.ajax.reload(); } else { utils.showAlert("error", "fas fa-times", "Failure! Something went wrong", response.message);