mirror of
https://github.com/Ximi1970/systray-x.git
synced 2026-07-19 18:30:31 +02:00
Add folders to the storage
This commit is contained in:
@@ -40,7 +40,8 @@ SysTrayX.Accounts = {
|
||||
}
|
||||
accounts[mailAccount[i].type].push({
|
||||
id: mailAccount[i].id,
|
||||
name: mailAccount[i].name
|
||||
name: mailAccount[i].name,
|
||||
folders: mailAccount[i].folders
|
||||
});
|
||||
}
|
||||
|
||||
@@ -70,8 +71,8 @@ SysTrayX.Accounts = {
|
||||
let typeLi = document.createElement("li");
|
||||
let typeInput = document.createElement("input");
|
||||
typeInput.setAttribute("type", "checkbox");
|
||||
typeInput.setAttribute("name", accounts[prop][i].name);
|
||||
typeInput.setAttribute("value", accounts[prop][i].id);
|
||||
typeInput.setAttribute("name", accounts[prop][i].id);
|
||||
typeInput.setAttribute("value", JSON.stringify(accounts[prop][i]));
|
||||
typeInput.setAttribute("checked", "true");
|
||||
typeLi.appendChild(typeInput);
|
||||
let typeText = document.createTextNode(" " + accounts[prop][i].name);
|
||||
@@ -91,7 +92,7 @@ SysTrayX.Accounts = {
|
||||
let accounts = result.accounts || [];
|
||||
for (let i = 0; i < accounts.length; ++i) {
|
||||
let checkbox = treeBase.querySelector(
|
||||
`input[value=${accounts[i].id}]`
|
||||
`input[name=${accounts[i].id}]`
|
||||
);
|
||||
if (checkbox) {
|
||||
checkbox.checked = accounts[i].checked;
|
||||
|
||||
@@ -22,11 +22,8 @@ function saveOptions(e) {
|
||||
let inputs = treeBase.querySelectorAll("input");
|
||||
let accounts = [];
|
||||
for (let i = 0; i < inputs.length; ++i) {
|
||||
accounts.push({
|
||||
id: inputs[i].value,
|
||||
name: inputs[i].name,
|
||||
checked: inputs[i].checked
|
||||
});
|
||||
let account = JSON.parse(inputs[i].value);
|
||||
accounts.push({ ...account, checked: inputs[i].checked });
|
||||
}
|
||||
|
||||
// Store accounts
|
||||
|
||||
Reference in New Issue
Block a user