Merge branch 'develop' into feature-unread

This commit is contained in:
Ximi1970
2020-05-09 18:05:27 +02:00

View File

@@ -55,10 +55,13 @@ SysTrayX.Accounts = {
console.debug("SysTrayX accounts type: " + mailAccount[i].type); console.debug("SysTrayX accounts type: " + mailAccount[i].type);
for (let j = 0; j < mailAccount[i].folders.length; j++) { for (let j = 0; j < mailAccount[i].folders.length; j++) {
console.debug( console.debug(
"SysTrayX accounts folder: " + "SysTrayX accounts folder path: " + mailAccount[i].folders[j].path
mailAccount[i].folders[j].name + );
", " + console.debug(
mailAccount[i].folders[j].type "SysTrayX accounts folder name: " + mailAccount[i].folders[j].name
);
console.debug(
"SysTrayX accounts folder type: " + mailAccount[i].folders[j].type
); );
} }
} }
@@ -120,10 +123,17 @@ SysTrayX.Accounts = {
); );
// Recursive list creator // Recursive list creator
function createListLevel(level) { function createListLevel(level, parent) {
const typeLevelUl = document.createElement("ul"); const typeLevelUl = document.createElement("ul");
typeLevelUl.setAttribute("class", "nested"); typeLevelUl.setAttribute("class", "nested");
if (parent) {
parent.children = [];
parent.name = "^ Add base folder";
level.unshift(parent);
}
level.forEach((element) => { level.forEach((element) => {
const typeEleLi = document.createElement("li"); const typeEleLi = document.createElement("li");
@@ -157,7 +167,9 @@ SysTrayX.Accounts = {
typeEleLi.appendChild(typeEleText); typeEleLi.appendChild(typeEleText);
if (element.children.length > 0) { if (element.children.length > 0) {
typeEleLi.appendChild(createListLevel(element.children)); typeEleLi.appendChild(
createListLevel(element.children, element)
);
} }
typeLevelUl.appendChild(typeEleLi); typeLevelUl.appendChild(typeEleLi);