mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
Fix back button in no-preview layout
layout setting
This commit is contained in:
parent
7bba9c17ea
commit
6928fcc48e
17 changed files with 385 additions and 238 deletions
|
|
@ -48,7 +48,7 @@ function MailBoxMessageListViewModel()
|
|||
this.dragOverBodyArea = ko.observable(null);
|
||||
|
||||
this.messageListItemTemplate = ko.computed(function () {
|
||||
return oData.usePreviewPane() ?
|
||||
return Enums.Layout.NoPreview !== oData.layout() ?
|
||||
'MailMessageListItem' : 'MailMessageListItemNoPreviewPane';
|
||||
});
|
||||
|
||||
|
|
@ -163,6 +163,11 @@ function MailBoxMessageListViewModel()
|
|||
this.selector.on('onItemSelect', _.bind(function (oMessage) {
|
||||
if (oMessage)
|
||||
{
|
||||
if (Enums.Layout.NoPreview === oData.layout())
|
||||
{
|
||||
kn.setHash(RL.link().messagePreview(), true);
|
||||
}
|
||||
|
||||
oData.message(oData.staticMessageList.populateByMessageListItem(oMessage));
|
||||
this.populateMessageBody(oData.message());
|
||||
}
|
||||
|
|
@ -723,7 +728,7 @@ MailBoxMessageListViewModel.prototype.onBuild = function (oDom)
|
|||
|
||||
if (oEvent && self.viewModelVisibility() && oData.useKeyboardShortcuts() && !RL.popupVisibility() && !oData.messageFullScreenMode() && !Utils.inFocus())
|
||||
{
|
||||
if (oData.usePreviewPane() || (!oData.message() && (Enums.EventKeyCode.Delete === iKeyCode || Enums.EventKeyCode.A === iKeyCode)))
|
||||
if (Enums.Layout.NoPreview !== oData.layout() || (!oData.message() && (Enums.EventKeyCode.Delete === iKeyCode || Enums.EventKeyCode.A === iKeyCode)))
|
||||
{
|
||||
if (oEvent.ctrlKey && Enums.EventKeyCode.A === iKeyCode)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ function MailBoxMessageViewViewModel()
|
|||
this.messagesBodiesDom = oData.messagesBodiesDom;
|
||||
this.useThreads = oData.useThreads;
|
||||
this.replySameFolder = oData.replySameFolder;
|
||||
this.usePreviewPane = oData.usePreviewPane;
|
||||
this.layout = oData.layout;
|
||||
this.isMessageSelected = oData.isMessageSelected;
|
||||
this.messageActiveDom = oData.messageActiveDom;
|
||||
this.messageError = oData.messageError;
|
||||
|
|
@ -44,7 +44,14 @@ function MailBoxMessageViewViewModel()
|
|||
|
||||
// commands
|
||||
this.closeMessage = Utils.createCommand(this, function () {
|
||||
oData.message(null);
|
||||
if (Enums.Layout.NoPreview === oData.layout())
|
||||
{
|
||||
RL.historyBack();
|
||||
}
|
||||
else
|
||||
{
|
||||
oData.message(null);
|
||||
}
|
||||
});
|
||||
|
||||
this.replyCommand = createCommandHelper(Enums.ComposeType.Reply);
|
||||
|
|
@ -247,13 +254,13 @@ MailBoxMessageViewViewModel.prototype.onBuild = function (oDom)
|
|||
iKeyCode = oEvent ? oEvent.keyCode : 0
|
||||
;
|
||||
|
||||
if (0 < iKeyCode && (Enums.EventKeyCode.Backspace === iKeyCode || Enums.EventKeyCode.Esc === iKeyCode) &&
|
||||
if (0 < iKeyCode && (Enums.EventKeyCode.Esc === iKeyCode) &&
|
||||
self.viewModelVisibility() && oData.useKeyboardShortcuts() && !Utils.inFocus() && oData.message())
|
||||
{
|
||||
self.fullScreenMode(false);
|
||||
if (!oData.usePreviewPane())
|
||||
if (Enums.Layout.NoPreview === oData.layout())
|
||||
{
|
||||
oData.message(null);
|
||||
RL.historyBack();
|
||||
}
|
||||
|
||||
bResult = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue