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);
|
var $el = this.$('.' + conversation.cid);
|
||||||
if ($el && $el.length > 0) {
|
if ($el && $el.length > 0) {
|
||||||
var index = getInboxCollection().indexOf(conversation);
|
var index = getInboxCollection().indexOf(conversation);
|
||||||
if (index > 0) {
|
if (index === 0) {
|
||||||
$el.insertBefore(this.$('.conversation-list-item')[index+1]);
|
|
||||||
} else {
|
|
||||||
this.$el.prepend($el);
|
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
Add a link
Reference in a new issue