Permalink
Browse files

Don't re-render bookmarks until after bulk adding during infinite scr…

…oll loads
  • Loading branch information...
dangrossman committed Feb 9, 2012
1 parent fa8aac9 commit 7dbea0dac65df225c6f1ae63570a0b252079a4a4
Showing with 4 additions and 0 deletions.
  1. +4 −0 public/js/views/BookmarksView.js
@@ -68,6 +68,8 @@ var BookmarksView = Backbone.View.extend({
if (bottom) {
$(window).unbind('scroll');
$.getJSON('/json/bookmark?offset=' + self.offset, function(data) {
+ self.collection.unbind('add');
+
self.offset += 50;
self.collection.add(data);
@@ -78,6 +80,8 @@ var BookmarksView = Backbone.View.extend({
});
$(window).scroll(function() { self.scroll(); });
+
+ self.collection.bind('add', self.render, self);
});
}
}

0 comments on commit 7dbea0d

Please sign in to comment.