mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +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
|
|
@ -38,7 +38,7 @@ import * as Local from 'Storage/Client';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { command, showScreenPopup, createCommand } from 'Knoin/Knoin';
|
||||
import { decorateKoCommands, showScreenPopup, createCommand } from 'Knoin/Knoin';
|
||||
import { AbstractViewRight } from 'Knoin/AbstractViews';
|
||||
|
||||
import { ComposePopupView } from 'View/Popup/Compose';
|
||||
|
|
@ -266,29 +266,32 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
|
|||
addEventListener('mailbox.message-view.toggle-full-screen', () => this.toggleFullScreen());
|
||||
|
||||
this.attachmentPreview = this.attachmentPreview.bind(this);
|
||||
|
||||
decorateKoCommands(this, {
|
||||
closeMessageCommand: 1,
|
||||
messageVisibilityCommand: self => self.messageVisibility(),
|
||||
messageEditCommand: self => self.messageVisibility(),
|
||||
goUpCommand: self => !self.messageListAndMessageViewLoading(),
|
||||
goDownCommand: self => !self.messageListAndMessageViewLoading()
|
||||
});
|
||||
}
|
||||
|
||||
@command()
|
||||
closeMessageCommand() {
|
||||
MessageStore.message(null);
|
||||
}
|
||||
|
||||
@command((self) => self.messageVisibility())
|
||||
messageVisibilityCommand() {} // eslint-disable-line no-empty-function
|
||||
messageVisibilityCommand() {}
|
||||
|
||||
@command((self) => self.messageVisibility())
|
||||
messageEditCommand() {
|
||||
this.editMessage();
|
||||
}
|
||||
|
||||
@command((self) => !self.messageListAndMessageViewLoading())
|
||||
goUpCommand() {
|
||||
dispatchEvent(new CustomEvent('mailbox.message-list.selector.go-up',
|
||||
{detail:SettingsStore.usePreviewPane() || !!this.message()} // bForceSelect
|
||||
));
|
||||
}
|
||||
|
||||
@command((self) => !self.messageListAndMessageViewLoading())
|
||||
goDownCommand() {
|
||||
dispatchEvent(new CustomEvent('mailbox.message-list.selector.go-down',
|
||||
{detail:SettingsStore.usePreviewPane() || !!this.message()} // bForceSelect
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue