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:
parent
e30b34f424
commit
6a611cbecf
1 changed files with 6 additions and 0 deletions
|
@ -47,6 +47,12 @@
|
||||||
var target = this.$('.' + targetConversation.cid);
|
var target = this.$('.' + targetConversation.cid);
|
||||||
$el.insertAfter(target);
|
$el.insertAfter(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($('.selected').length) {
|
||||||
|
$('.selected')[0].scrollIntoView({
|
||||||
|
block: 'nearest',
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
removeItem: function(conversation) {
|
removeItem: function(conversation) {
|
||||||
var $el = this.$('.' + conversation.cid);
|
var $el = this.$('.' + conversation.cid);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue