diff --git a/src/webview/scripts.js b/src/webview/scripts.js
index 48e6fad..371d773 100644
--- a/src/webview/scripts.js
+++ b/src/webview/scripts.js
@@ -9,11 +9,13 @@ document.addEventListener('click', function (event) {
closeDropdowns();
});
-function closeDropdowns() {
+function closeDropdowns(except) {
// Get all elements with class="dropdowns" and hide them
var dropdowns = document.getElementsByClassName("dropdown is-active");
for (i = 0; i < dropdowns.length; i++) {
- dropdowns[i].classList.remove('is-active');
+ if (dropdowns[i] != except) {
+ dropdowns[i].classList.remove('is-active');
+ }
}
}
@@ -120,7 +122,7 @@ function addMyDomain(name, timestamp, data) {
}
function refreshMyDomains() {
- var card = '
';
+ var card = '';
var tag = '{domain}';
var cards = "";
myDomains.forEach(function(value, index, array) {
@@ -147,7 +149,7 @@ function refreshMyDomains() {
document.getElementById("my_domains").innerHTML = cards;
}
-function editDomain(domain) {
+function editDomain(domain, event) {
myDomains.forEach(function(value, index, array) {
if (domain != value.name) {
return;
@@ -161,7 +163,13 @@ function editDomain(domain) {
});
}
document.getElementById("new_domain").value = title.replace("." + domain_data.zone, "");
- changeZone(domain_data.zone);
+ if (typeof domain_data.info !== 'undefined') {
+ document.getElementById("info_text").value = domain_data.info;
+ }
+ if (typeof domain_data.contacts !== 'undefined') {
+ document.getElementById("contacts_text").value = domain_data.contacts.join("\n");
+ }
+ changeZone(domain_data.zone, event);
refreshRecordsList();
showNewDomainDialog();
});
@@ -199,7 +207,7 @@ function openTab(element, tabName) {
function toggle(element, event) {
event.stopPropagation();
- closeDropdowns();
+ closeDropdowns(element);
element.classList.toggle('is-active');
}