|
|
@ -13,27 +13,26 @@ class View {
|
|
|
|
tag.classList.add("caret");
|
|
|
|
tag.classList.add("caret");
|
|
|
|
|
|
|
|
|
|
|
|
ulToAdd.appendChild(tag);
|
|
|
|
ulToAdd.appendChild(tag);
|
|
|
|
if (dirtree.length > 1) {
|
|
|
|
var newul = document.createElement("ul");
|
|
|
|
var newul = document.createElement("ul");
|
|
|
|
newul.classList.add("nested");
|
|
|
|
newul.classList.add("nested");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tag.parentElement.appendChild(newul);
|
|
|
|
tag.parentElement.appendChild(newul);
|
|
|
|
for (let i = 1; i < dirtree.length; i++) {
|
|
|
|
for (let i = 1; i < dirtree.length; i++) {
|
|
|
|
if (Array.isArray(dirtree[i])) {
|
|
|
|
if (Array.isArray(dirtree[i])) {
|
|
|
|
this.drawDirTree(dirtree[i], newul, parrentObj);
|
|
|
|
this.drawDirTree(dirtree[i], newul, parrentObj);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
var tag = document.createElement("li");
|
|
|
|
var tag = document.createElement("li");
|
|
|
|
var text = document.createTextNode(dirtree[i]);
|
|
|
|
var text = document.createTextNode(dirtree[i]);
|
|
|
|
tag.appendChild(text);
|
|
|
|
tag.appendChild(text);
|
|
|
|
newul.appendChild(tag);
|
|
|
|
newul.appendChild(tag);
|
|
|
|
var _this = this;
|
|
|
|
var _this = this;
|
|
|
|
tag.addEventListener("click", function () {
|
|
|
|
tag.addEventListener("click", function () {
|
|
|
|
parrentObj.loadFile(dirtree[0] + dirtree[i]);
|
|
|
|
parrentObj.loadFile(dirtree[0] + dirtree[i]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
openFile(fileread) {
|
|
|
|
openFile(fileread) {
|
|
|
|
let textArea = document.getElementsByTagName("textarea")[0];
|
|
|
|
let textArea = document.getElementsByTagName("textarea")[0];
|
|
|
@ -86,7 +85,7 @@ class View {
|
|
|
|
|
|
|
|
|
|
|
|
showSaveButton(show) {
|
|
|
|
showSaveButton(show) {
|
|
|
|
var saveButton = document.getElementById("saveBtn");
|
|
|
|
var saveButton = document.getElementById("saveBtn");
|
|
|
|
if(show) {
|
|
|
|
if (show) {
|
|
|
|
saveButton.disabled = false;
|
|
|
|
saveButton.disabled = false;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
saveButton.disabled = true;
|
|
|
|
saveButton.disabled = true;
|
|
|
|