Skip to content

Commit

Permalink
Move sort after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ganmor committed Jun 25, 2012
1 parent cf80581 commit 6df4874
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@
this.length += length;
index = options.at != null ? options.at : this.models.length;
splice.apply(this.models, [index, 0].concat(models));
if (this.comparator && options.at == null) this.sort({silent: true});


// Merge in duplicate models.
if (options.merge) {
Expand All @@ -629,6 +629,7 @@
}
}
}
if (this.comparator && options.at == null) this.sort({silent: true});

if (options.silent) return this;
for (i = 0, length = this.models.length; i < length; i++) {
Expand Down

0 comments on commit 6df4874

Please sign in to comment.