mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
some ko.computed() to addComputables()/addComputablesTo()
This commit is contained in:
parent
099560ca6a
commit
023c8f603b
9 changed files with 110 additions and 107 deletions
|
|
@ -7,7 +7,8 @@ import {
|
|||
changeTheme,
|
||||
convertThemeName,
|
||||
addObservablesTo,
|
||||
addSubscribablesTo
|
||||
addSubscribablesTo,
|
||||
addComputablesTo
|
||||
} from 'Common/Utils';
|
||||
|
||||
import { Capa, SaveSettingsStep } from 'Common/Enums';
|
||||
|
|
@ -74,12 +75,12 @@ export class GeneralAdminSettings {
|
|||
].join('')
|
||||
: '';
|
||||
|
||||
this.themesOptions = ko.computed(() =>
|
||||
this.themes.map(theme => ({ optValue: theme, optText: convertThemeName(theme) }))
|
||||
);
|
||||
addComputablesTo(this, {
|
||||
themesOptions: () => this.themes.map(theme => ({ optValue: theme, optText: convertThemeName(theme) })),
|
||||
|
||||
this.languageFullName = ko.computed(() => convertLangName(this.language()));
|
||||
this.languageAdminFullName = ko.computed(() => convertLangName(this.languageAdmin()));
|
||||
languageFullName: () => convertLangName(this.language()),
|
||||
languageAdminFullName: () => convertLangName(this.languageAdmin())
|
||||
});
|
||||
|
||||
this.languageAdminTrigger = ko.observable(SaveSettingsStep.Idle).extend({ debounce: 100 });
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue