mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Resolve #766
This commit is contained in:
parent
9c3fe7d4e5
commit
e0f3995e85
2 changed files with 18 additions and 10 deletions
|
|
@ -64,6 +64,11 @@ const
|
|||
|
||||
currentMessage = MessageUserStore.message,
|
||||
|
||||
setAction = action => {
|
||||
const message = currentMessage();
|
||||
message && MessagelistUserStore.setAction(message.folder, action, [message]);
|
||||
},
|
||||
|
||||
fetchRaw = url => rl.fetch(url).then(response => response.ok && response.text());
|
||||
|
||||
export class MailMessageView extends AbstractViewRight {
|
||||
|
|
@ -219,7 +224,7 @@ export class MailMessageView extends AbstractViewRight {
|
|||
this.notSpamCommand = createCommandActionHelper(FolderType.NotSpam);
|
||||
|
||||
decorateKoCommands(this, {
|
||||
messageEditCommand: self => self.messageVisibility(),
|
||||
editCommand: self => self.messageVisibility(),
|
||||
goUpCommand: self => !self.messageListOrViewLoading(),
|
||||
goDownCommand: self => !self.messageListOrViewLoading()
|
||||
});
|
||||
|
|
@ -233,10 +238,15 @@ export class MailMessageView extends AbstractViewRight {
|
|||
currentMessage(null);
|
||||
}
|
||||
|
||||
messageEditCommand() {
|
||||
editCommand() {
|
||||
currentMessage() && showMessageComposer([ComposeType.Draft, currentMessage()]);
|
||||
}
|
||||
|
||||
setUnseen() {
|
||||
setAction(MessageSetAction.UnsetSeen);
|
||||
currentMessage(null);
|
||||
}
|
||||
|
||||
goUpCommand() {
|
||||
fireEvent('mailbox.message-list.selector.go-up',
|
||||
!!currentMessage() // bForceSelect
|
||||
|
|
@ -319,12 +329,7 @@ export class MailMessageView extends AbstractViewRight {
|
|||
}
|
||||
|
||||
if (eqs(event, '.messageItemHeader .subjectParent .flagParent')) {
|
||||
const message = currentMessage();
|
||||
message && MessagelistUserStore.setAction(
|
||||
message.folder,
|
||||
message.isFlagged() ? MessageSetAction.UnsetFlag : MessageSetAction.SetFlag,
|
||||
[message]
|
||||
);
|
||||
setAction(currentMessage()?.isFlagged() ? MessageSetAction.UnsetFlag : MessageSetAction.SetFlag);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<a class="btn buttonClose fontastic" data-bind="click: closeMessage">✖</a>
|
||||
</div>
|
||||
<div class="btn-group" data-bind="visible: isDraftFolder()" data-i18n="[title]MESSAGE/BUTTON_EDIT">
|
||||
<a class="btn btn-success buttonEdit fontastic" data-bind="command: messageEditCommand">🖉</a>
|
||||
<a class="btn btn-success buttonEdit fontastic" data-bind="command: editCommand">🖉</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a class="btn fontastic" data-bind="visible: archiveAllowed, command: archiveCommand" data-i18n="[title]GLOBAL/TO_ARCHIVE">🗄</a>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
<!-- ko if: message -->
|
||||
<div class="b-message" data-bind="i18nUpdate: message, css: message().lineAsCss(0)">
|
||||
<div class="message-fixed-button-toolbar">
|
||||
<a class="btn btn-success buttonEdit fontastic hide-mobile" data-bind="visible: isDraftFolder(), command: messageEditCommand">🖉</a>
|
||||
<a class="btn btn-success buttonEdit fontastic hide-mobile" data-bind="visible: isDraftFolder(), command: editCommand">🖉</a>
|
||||
<div class="btn-group" style="margin-right: -8px; display: inline;">
|
||||
<span data-bind="visible: canBeRepliedOrForwarded">
|
||||
<a class="btn btn-thin btn-transparent buttonReply fontastic"
|
||||
|
|
@ -65,6 +65,9 @@
|
|||
</li>
|
||||
</div>
|
||||
<div class="dividerbar">
|
||||
<li role="presentation">
|
||||
<a href="#" tabindex="-1" data-bind="click: setUnseen" data-icon=" " data-i18n="MESSAGE_LIST/MENU_UNSET_SEEN"></a>
|
||||
</li>
|
||||
<li role="presentation" data-bind="visible: archiveAllowed">
|
||||
<a href="#" tabindex="-1" data-bind="command: archiveCommand" data-icon="🗄" data-i18n="GLOBAL/TO_ARCHIVE"></a>
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue