(js) Improve scrolling behavior when deleting msg

Fixes #3489
This commit is contained in:
Francis Lachapelle
2016-02-03 10:51:59 -05:00
parent 47701e880a
commit 1a7e5c248f
3 changed files with 8 additions and 1 deletions
@@ -133,7 +133,10 @@
try {
if (nextMessage) {
state.go('mail.account.mailbox.message', { messageId: nextMessage.uid });
mailbox.$topIndex = nextIndex;
if (nextIndex < mailbox.$topIndex)
mailbox.$topIndex = nextIndex;
else if (nextIndex > mailbox.$lastVisibleIndex)
mailbox.$topIndex = nextIndex - (mailbox.$lastVisibleIndex - mailbox.$topIndex);
}
else {
state.go('mail.account.mailbox');