Resolve Add a "Move to" button inside message view #1295

This commit is contained in:
the-djmaze 2023-11-26 18:06:19 +01:00
parent eb802135a9
commit 77d2d099e2
3 changed files with 18 additions and 3 deletions

View file

@ -1,7 +1,7 @@
import ko from 'ko';
import { addObservablesTo, addComputablesTo, addSubscribablesTo } from 'External/ko';
import { ScopeMessageList, ScopeMessageView } from 'Common/Enums';
import { ScopeFolderList, ScopeMessageList, ScopeMessageView } from 'Common/Enums';
import {
ComposeType,
@ -105,6 +105,8 @@ export class MailMessageView extends AbstractViewRight {
showAttachmentControls: !!Local.get(ClientSideKeyNameMessageAttachmentControls),
downloadAsZipLoading: false,
showFullInfo: '1' === Local.get(ClientSideKeyNameMessageHeaderFullInfo),
// bootstrap dropdown
actionsMenu: null,
// viewer
viewFromShort: '',
dkimData: ['none', '', '']
@ -229,6 +231,7 @@ export class MailMessageView extends AbstractViewRight {
decorateKoCommands(this, {
editCommand: self => self.messageVisibility(),
moveCommand: self => self.messageVisibility(),
goUpCommand: self => !self.messageListOrViewLoading(),
goDownCommand: self => !self.messageListOrViewLoading()
});
@ -246,6 +249,15 @@ export class MailMessageView extends AbstractViewRight {
currentMessage() && showMessageComposer([ComposeType.Draft, currentMessage()]);
}
moveCommand(vm, event) {
if (vm && event?.preventDefault) {
stopEvent(event);
}
this.actionsMenu().ddBtn.hide();
AppUserStore.focusedState(ScopeFolderList);
moveAction(true);
}
setUnseen() {
setAction(MessageSetAction.UnsetSeen);
currentMessage(null);