зеркало из https://github.com/nextcloud/spreed.git
Remove unneeded code
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:
Родитель
d00f88f526
Коммит
e03700372e
|
@ -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) &&
|
||||
|
|
Загрузка…
Ссылка в новой задаче