|
|
|
@ -6,11 +6,12 @@ class View {
|
|
|
|
|
var tag = document.createElement("li");
|
|
|
|
|
var text = document.createTextNode(dirtree[0]);
|
|
|
|
|
tag.appendChild(text);
|
|
|
|
|
tag.style.fontWeight = "bold";
|
|
|
|
|
tag.classList.add("caret");
|
|
|
|
|
|
|
|
|
|
ulToAdd.appendChild(tag);
|
|
|
|
|
if (dirtree.length > 1) {
|
|
|
|
|
var newul = document.createElement("ul");
|
|
|
|
|
newul.classList.add("nested");
|
|
|
|
|
|
|
|
|
|
tag.parentElement.appendChild(newul);
|
|
|
|
|
for (let i = 1; i < dirtree.length; i++) {
|
|
|
|
@ -33,4 +34,23 @@ class View {
|
|
|
|
|
}
|
|
|
|
|
this.hloubka = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dirTreeToggler() {
|
|
|
|
|
var toggler = document.getElementsByClassName("caret");
|
|
|
|
|
var i;
|
|
|
|
|
|
|
|
|
|
function addClass() {
|
|
|
|
|
this.nextSibling.classList.toggle("active");
|
|
|
|
|
this.classList.toggle("caret-down");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < toggler.length; i++) {
|
|
|
|
|
toggler[i].addEventListener("click", addClass);
|
|
|
|
|
}
|
|
|
|
|
toggler[0].classList.add("caret-down");
|
|
|
|
|
if (toggler[0].nextSibling) {
|
|
|
|
|
toggler[0].nextSibling.classList.add("active");
|
|
|
|
|
}
|
|
|
|
|
toggler[0].removeEventListener("click", addClass);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|