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

@ -173,7 +173,7 @@ html.rl-left-panel-disabled {
top: 0;
bottom: 0;
width: 50vw;
z-index: 3;
z-index: 99;
}
.rl-left-panel-disabled #rl-left {
display: none;

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);

View file

@ -40,7 +40,7 @@
<a class="btn btn-thin btn-transparent buttonReplyAll fontastic"
data-bind="visible: 2 == msgDefaultAction(), command: replyAllCommand" data-i18n="[title]MESSAGE/BUTTON_REPLY_ALL">↞</a>
</span>
<div class="btn-group" data-bind="registerBootstrapDropdown: true" style="display: inline-block">
<div class="btn-group" data-bind="registerBootstrapDropdown: true, initDom: actionsMenu" style="display: inline-block">
<a class="btn btn-thin btn-transparent dropdown-toggle fontastic" id="more-view-dropdown-id" href="#" tabindex="-1"></a>
<menu class="dropdown-menu right-edge" role="menu" aria-labelledby="more-view-dropdown-id">
<div data-bind="visible: !isDraftFolder()">
@ -76,6 +76,9 @@
<span data-i18n="GLOBAL/NOT_SPAM"></span>
</a>
</li>
<li role="presentation">
<a href="#" tabindex="-1" data-bind="command: moveCommand" data-icon="📁" data-i18n="GLOBAL/MOVE_TO"></a>
</li>
<li role="presentation">
<a href="#" tabindex="-1" data-bind="command: deleteCommand" data-icon="🗑" data-i18n="GLOBAL/DELETE"></a>
</li>