mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 05:59: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
|
|
@ -1,5 +1,3 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { getNotification } from 'Common/Translator';
|
||||
|
||||
import { DomainAdminStore } from 'Stores/Admin/Domain';
|
||||
|
|
@ -22,11 +20,13 @@ class DomainAliasPopupView extends AbstractViewPopup {
|
|||
alias: ''
|
||||
});
|
||||
|
||||
this.domains = ko.computed(() => DomainAdminStore.filter(item => item && !item.alias));
|
||||
this.addComputables({
|
||||
domains: () => DomainAdminStore.filter(item => item && !item.alias),
|
||||
|
||||
this.domainsOptions = ko.computed(() => this.domains().map(item => ({ optValue: item.name, optText: item.name })));
|
||||
domainsOptions: () => this.domains().map(item => ({ optValue: item.name, optText: item.name })),
|
||||
|
||||
this.canBeSaved = ko.computed(() => !this.saving() && this.name() && this.alias());
|
||||
canBeSaved: () => !this.saving() && this.name() && this.alias()
|
||||
});
|
||||
|
||||
decorateKoCommands(this, {
|
||||
createCommand: self => self.canBeSaved()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue