mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Remove knockout-transformations dependency
This commit is contained in:
parent
8a0be3212d
commit
40dc22a317
10 changed files with 69 additions and 78 deletions
|
|
@ -47,14 +47,16 @@ class ContactsAdminSettings {
|
|||
this.contactsSupported = 0 < supportedTypes.length;
|
||||
|
||||
this.contactsTypes = ko.observableArray([]);
|
||||
this.contactsTypesOptions = this.contactsTypes.map((value) => {
|
||||
const disabled = -1 === inArray(value, supportedTypes);
|
||||
return {
|
||||
'id': value,
|
||||
'name': getTypeName(value) + (disabled ? ' (' + i18n('HINTS/NOT_SUPPORTED') + ')' : ''),
|
||||
'disabled': disabled
|
||||
};
|
||||
});
|
||||
this.contactsTypesOptions = ko.computed(() =>
|
||||
_.map(this.contactsTypes(), (value) => {
|
||||
const disabled = -1 === inArray(value, supportedTypes);
|
||||
return {
|
||||
'id': value,
|
||||
'name': getTypeName(value) + (disabled ? ' (' + i18n('HINTS/NOT_SUPPORTED') + ')' : ''),
|
||||
'disabled': disabled
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
this.contactsTypes(types);
|
||||
this.contactsType = ko.observable('');
|
||||
|
|
|
|||
|
|
@ -18,9 +18,15 @@ class PackagesAdminSettings {
|
|||
this.packagesReal = PackageStore.packagesReal;
|
||||
this.packagesMainUpdatable = PackageStore.packagesMainUpdatable;
|
||||
|
||||
this.packagesCurrent = this.packages.filter((item) => item && '' !== item.installed && !item.compare);
|
||||
this.packagesAvailableForUpdate = this.packages.filter((item) => item && '' !== item.installed && !!item.compare);
|
||||
this.packagesAvailableForInstallation = this.packages.filter((item) => item && '' === item.installed);
|
||||
this.packagesCurrent = ko.computed(() =>
|
||||
_.filter(this.packages(), (item) => item && '' !== item.installed && !item.compare)
|
||||
);
|
||||
this.packagesAvailableForUpdate = ko.computed(() =>
|
||||
_.filter(this.packages(), (item) => item && '' !== item.installed && !!item.compare)
|
||||
);
|
||||
this.packagesAvailableForInstallation = ko.computed(() =>
|
||||
_.filter(this.packages(), (item) => item && '' === item.installed)
|
||||
);
|
||||
|
||||
this.visibility = ko.computed(() => (PackageStore.packages.loading() ? 'visible' : 'hidden'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue