mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 13:39:22 +03:00
Replace babel command decorators with proper knockout command decorators
This commit is contained in:
parent
b6d8fa5b3f
commit
540b12ed26
27 changed files with 181 additions and 132 deletions
|
|
@ -7,7 +7,7 @@ import { DomainAdminStore } from 'Stores/Admin/Domain';
|
|||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { decorateKoCommands } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
class DomainAliasPopupView extends AbstractViewPopup {
|
||||
|
|
@ -30,9 +30,12 @@ class DomainAliasPopupView extends AbstractViewPopup {
|
|||
this.canBeSaved = ko.computed(() => !this.saving() && this.name() && this.alias());
|
||||
|
||||
this.onDomainAliasCreateOrSaveResponse = this.onDomainAliasCreateOrSaveResponse.bind(this);
|
||||
|
||||
decorateKoCommands(this, {
|
||||
createCommand: self => self.canBeSaved()
|
||||
});
|
||||
}
|
||||
|
||||
@command((self) => self.canBeSaved())
|
||||
createCommand() {
|
||||
this.saving(true);
|
||||
Remote.createDomainAlias(this.onDomainAliasCreateOrSaveResponse, this.name(), this.alias());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue