Fix sorting of the last element
// FREEBIE
This commit is contained in:
parent
8fe00f79b2
commit
8c03d3e088
1 changed files with 5 additions and 3 deletions
|
@ -13,10 +13,12 @@
|
|||
var $el = this.$('.' + conversation.cid);
|
||||
if ($el && $el.length > 0) {
|
||||
var index = getInboxCollection().indexOf(conversation);
|
||||
if (index > 0) {
|
||||
$el.insertBefore(this.$('.conversation-list-item')[index+1]);
|
||||
} else {
|
||||
if (index === 0) {
|
||||
this.$el.prepend($el);
|
||||
} else if (index === this.collection.length - 1) {
|
||||
this.$el.append($el);
|
||||
} else {
|
||||
$el.insertBefore(this.$('.conversation-list-item')[index+1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue