mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 19:19:21 +03:00
A new way to move in message list (message focused state).
Delete/Move optimizations. Display next message after deletion (Closes #120) Scrolling in message view (Closes #109)
This commit is contained in:
parent
a96e1d80c3
commit
0b30bac43f
17 changed files with 784 additions and 431 deletions
|
|
@ -19,6 +19,7 @@ function MailBoxMessageListViewModel()
|
|||
this.message = oData.message;
|
||||
this.messageList = oData.messageList;
|
||||
this.currentMessage = oData.currentMessage;
|
||||
this.currentFocusedMessage = oData.currentFocusedMessage;
|
||||
this.isMessageSelected = oData.isMessageSelected;
|
||||
this.messageListSearch = oData.messageListSearch;
|
||||
this.messageListError = oData.messageListError;
|
||||
|
|
@ -191,8 +192,9 @@ function MailBoxMessageListViewModel()
|
|||
|
||||
this.quotaTooltip = _.bind(this.quotaTooltip, this);
|
||||
|
||||
this.selector = new Selector(this.messageList, this.currentMessage,
|
||||
'.messageListItem .actionHandle', '.messageListItem.selected', '.messageListItem .checkboxMessage');
|
||||
this.selector = new Selector(this.messageList, this.currentFocusedMessage, this.currentMessage,
|
||||
'.messageListItem .actionHandle', '.messageListItem.selected', '.messageListItem .checkboxMessage',
|
||||
'.messageListItem.focused');
|
||||
|
||||
this.selector.on('onItemSelect', _.bind(function (oMessage) {
|
||||
if (oMessage)
|
||||
|
|
@ -214,7 +216,14 @@ function MailBoxMessageListViewModel()
|
|||
this.selector.on('onItemGetUid', function (oMessage) {
|
||||
return oMessage ? oMessage.generateUid() : '';
|
||||
});
|
||||
|
||||
|
||||
// this.selector.autoSelect(false);
|
||||
oData.layout.subscribe(function (mValue) {
|
||||
this.selector.autoSelect(Enums.Layout.NoPreview !== mValue);
|
||||
}, this);
|
||||
|
||||
oData.layout.valueHasMutated();
|
||||
|
||||
RL
|
||||
.sub('mailbox.message-list.selector.go-down', function () {
|
||||
this.selector.goDown();
|
||||
|
|
@ -687,7 +696,7 @@ MailBoxMessageListViewModel.prototype.initShortcuts = function ()
|
|||
});
|
||||
|
||||
// change focused state
|
||||
key('tab, enter', Enums.KeyState.MessageList, function () {
|
||||
key('tab', Enums.KeyState.MessageList, function () {
|
||||
if (oData.useKeyboardShortcuts())
|
||||
{
|
||||
if (self.message())
|
||||
|
|
|
|||
|
|
@ -385,11 +385,10 @@ MailBoxMessageViewViewModel.prototype.escShortcuts = function ()
|
|||
else
|
||||
{
|
||||
this.message.focused(false);
|
||||
}
|
||||
|
||||
if (Enums.Layout.NoPreview === RL.data().layout())
|
||||
{
|
||||
RL.historyBack();
|
||||
if (Enums.Layout.NoPreview === RL.data().layout())
|
||||
{
|
||||
RL.historyBack();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
@ -493,7 +492,6 @@ MailBoxMessageViewViewModel.prototype.initShortcuts = function ()
|
|||
key('delete, shift+delete', Enums.KeyState.MessageView, function (event, handler) {
|
||||
if (oData.useKeyboardShortcuts() && event)
|
||||
{
|
||||
self.deleteCommand();
|
||||
if (handler && 'shift+delete' === handler.shortcut)
|
||||
{
|
||||
self.deleteWithoutMoveCommand();
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ function PopupsContactsViewModel()
|
|||
this.contacts = ko.observableArray([]);
|
||||
this.contacts.loading = ko.observable(false).extend({'throttle': 200});
|
||||
this.contacts.importing = ko.observable(false).extend({'throttle': 200});
|
||||
|
||||
this.currentContact = ko.observable(null);
|
||||
this.currentFocusedContact = ko.observable(null);
|
||||
|
||||
this.importUploaderButton = ko.observable(null);
|
||||
|
||||
|
|
@ -160,8 +162,9 @@ function PopupsContactsViewModel()
|
|||
});
|
||||
}, this);
|
||||
|
||||
this.selector = new Selector(this.contacts, this.currentContact,
|
||||
'.e-contact-item .actionHandle', '.e-contact-item.selected', '.e-contact-item .checkboxItem');
|
||||
this.selector = new Selector(this.contacts, this.currentFocusedContact, this.currentContact,
|
||||
'.e-contact-item .actionHandle', '.e-contact-item.selected', '.e-contact-item .checkboxItem',
|
||||
'.e-contact-item.focused');
|
||||
|
||||
this.selector.on('onItemSelect', _.bind(function (oContact) {
|
||||
this.populateViewContact(oContact ? oContact : null);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue