mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Resolve #240
This commit is contained in:
parent
f23dd5a431
commit
d63b2000b6
1 changed files with 21 additions and 6 deletions
|
|
@ -42,14 +42,22 @@ class PluginPopupView extends AbstractViewPopup {
|
||||||
const oConfig = {
|
const oConfig = {
|
||||||
Id: this.id(),
|
Id: this.id(),
|
||||||
Settings: {}
|
Settings: {}
|
||||||
};
|
},
|
||||||
|
setItem = item => {
|
||||||
this.config.forEach(oItem => {
|
let value = item.value();
|
||||||
let value = oItem.value();
|
|
||||||
if (false === value || true === value) {
|
if (false === value || true === value) {
|
||||||
value = value ? 1 : 0;
|
value = value ? 1 : 0;
|
||||||
}
|
}
|
||||||
oConfig.Settings[oItem.Name] = value;
|
oConfig.Settings[item.Name] = value;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.config.forEach(oItem => {
|
||||||
|
if (7 == oItem.Type) {
|
||||||
|
// Group
|
||||||
|
oItem.config.forEach(oSubItem => setItem(oSubItem));
|
||||||
|
} else {
|
||||||
|
setItem(oItem);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.saveError('');
|
this.saveError('');
|
||||||
|
|
@ -75,7 +83,14 @@ class PluginPopupView extends AbstractViewPopup {
|
||||||
if (arrayLength(config)) {
|
if (arrayLength(config)) {
|
||||||
this.config(
|
this.config(
|
||||||
config.map(item => {
|
config.map(item => {
|
||||||
|
if (7 == item.Type) {
|
||||||
|
// Group
|
||||||
|
item.config.forEach(subItem => {
|
||||||
|
subItem.value = ko.observable(subItem.value);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
item.value = ko.observable(item.value);
|
item.value = ko.observable(item.value);
|
||||||
|
}
|
||||||
return item;
|
return item;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue