Currently models are only appended, so there is no need to handle an
insertion. Moreover, it is not handled anywhere else, so even if a model
was inserted the result would be broken.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2018-10-10 19:19:15 +02:00
Родитель d00f88f526
Коммит e03700372e
1 изменённых файлов: 2 добавлений и 6 удалений

Просмотреть файл

@ -388,18 +388,14 @@
return data;
},
_onAddModel: function(model, collection, options) {
_onAddModel: function(model) {
this.$el.find('.emptycontent').toggleClass('hidden', true);
var $newestComment = this.$container.children('.comment').last();
var scrollToNew = $newestComment.length > 0 && this._getCommentTopPosition($newestComment) < this.$container.outerHeight();
var $el = $(this.commentTemplate(this._formatItem(model)));
if (!_.isUndefined(options.at) && collection.length > 1) {
this.$container.find('li').eq(options.at).before($el);
} else {
this.$container.append($el);
}
this.$container.append($el);
if (this._modelsHaveSameActor(this._lastAddedMessageModel, model) &&
this._modelsAreTemporaryNear(this._lastAddedMessageModel, model) &&