Skip to content

Commit

Permalink
fix bug with Collection.onSort
Browse files Browse the repository at this point in the history
  • Loading branch information
andreypopp committed Apr 25, 2013
1 parent f35fc1a commit df6b82a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backbone.viewdsl.coffee
Expand Up @@ -544,13 +544,13 @@
this.collection.forEach (model, newIdx) =>
{view, idx} = this.viewByModel(model)
this.views.splice(idx, 1)[0]
this.views.splice(newIdx, view)
this.views.splice(newIdx, 0, view)
view.options.index = newIdx
view.$el.detach()
view.digest()
if not $cur
this.$el.append view.$el
else
else
view.$el.after $cur
$cur = view.$el

Expand Down

0 comments on commit df6b82a

Please sign in to comment.