1
0
mirror of https://github.com/salexdv/bsl_console.git synced 2024-11-24 08:33:29 +02:00

Доработка навигации по дереву переменных

This commit is contained in:
salexdv 2022-08-25 13:20:22 +03:00
parent 08f9a80381
commit a0e1b6d78a
2 changed files with 14 additions and 2 deletions

View File

@ -93,6 +93,10 @@
background-image: url('./icons/empty.png'); background-image: url('./icons/empty.png');
} }
#variables-tree details[open] > summary.final:before {
background-image: url('./icons/empty.png');
}
#variables-tree summary:before { #variables-tree summary:before {
content: '.'; content: '.';
padding-left: 7px; padding-left: 7px;

View File

@ -38,6 +38,14 @@ class Treeview {
}, 500); }, 500);
} }
} }
else if (eventData.target.classList.contains('final')) {
eventData.preventDefault();
}
}
else if (eventData.target.nodeName == 'SUMMARY' && eventData.target.parentNode.hasAttribute("open")) {
}
else {
eventData.preventDefault();
} }
break; break;
} }
@ -57,7 +65,7 @@ class Treeview {
if (targetId != null) { if (targetId != null) {
let target = document.getElementById(targetId); let target = document.getElementById(targetId);
target.parentNode.outerHTML = this.parseData(data) target.parentNode.outerHTML = this.parseData(data)
target.dataset.requested = true; document.getElementById(targetId).dataset.requested = true;
} }
else { else {
let target = document.querySelector(this.treeviewId); let target = document.querySelector(this.treeviewId);
@ -90,7 +98,7 @@ class Treeview {
let node = document.getElementById(id).parentNode; let node = document.getElementById(id).parentNode;
node.removeAttribute("open"); node.removeAttribute("open");
let detailNodes = node.querySelectorAll("DETAILS"); let detailNodes = node.querySelectorAll("DETAILS");
console.log(detailNodes); detailNodes.forEach((node) => node.removeAttribute("open")); detailNodes.forEach((node) => node.removeAttribute("open"));
}; };
select(id) { select(id) {
this.open(id); this.open(id);