Auto-scroll to selected conversation when reordering them (#2498)

When conversations are reordered (last message time has changed), this commit leads to scrolling the shortest distance to the conversation.
This commit is contained in:
Matthias Beaupère 2018-07-05 18:52:24 +02:00 committed by Scott Nonnenberg
parent e30b34f424
commit 6a611cbecf
1 changed files with 6 additions and 0 deletions

View File

@ -47,6 +47,12 @@
var target = this.$('.' + targetConversation.cid);
$el.insertAfter(target);
}
if ($('.selected').length) {
$('.selected')[0].scrollIntoView({
block: 'nearest',
});
}
},
removeItem: function(conversation) {
var $el = this.$('.' + conversation.cid);