Skip to content

Commit

Permalink
Hid the save button if no changes were made
Browse files Browse the repository at this point in the history
  • Loading branch information
ctih2 committed Apr 22, 2024
1 parent 287953e commit 999d58b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion account/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h1 class="mb-5">Your domains</h1>
</tr>
</tbody>
</table>
<button onclick="send();"class="btn btn-outline-primary">Save</button>
<button id="save-changes" onclick="send();"class="btn btn-outline-primary">Save</button>
<h5 id="result"></h5>
</div>
</div>
Expand Down
7 changes: 6 additions & 1 deletion account/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 999d58b

Please sign in to comment.