From 999d58bf3aeb5de5d0abbdd944bcbf10f5894cf2 Mon Sep 17 00:00:00 2001 From: Onni Nevala Date: Mon, 22 Apr 2024 22:31:20 +0300 Subject: [PATCH] Hid the save button if no changes were made --- account/dashboard.html | 2 +- account/dashboard.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/account/dashboard.html b/account/dashboard.html index 0c26bd3..602b6c2 100644 --- a/account/dashboard.html +++ b/account/dashboard.html @@ -35,7 +35,7 @@

Your domains

- +
diff --git a/account/dashboard.js b/account/dashboard.js index 3ae2a89..be80c31 100644 --- a/account/dashboard.js +++ b/account/dashboard.js @@ -3,7 +3,9 @@ const table = document.getElementById("domain-table"); const info = document.getElementById("result"); const error_messages = document.getElementById("error-messages"); const delete_button = document.getElementById("delete-button"); +const save_button = document.getElementById("save-changes"); +save_button.style.display = "none"; var record_dd; const loader = document.getElementById("loader"); var columns = 0; @@ -34,7 +36,10 @@ function isLoggedIn() { } function changed(from) { - changedDomains.set(from.parentNode.parentNode.children[1].textContent,from.value) + changedDomains.set(from.parentNode.parentNode.children[1].textContent,from.value); + if(changedDomains.size!==0) { + save_button.style.display = "inline-block"; + } } function addDomain(domain, ipv4, true_domain, type) {