Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…oll loads
  • Loading branch information...
commit 7dbea0dac65df225c6f1ae63570a0b252079a4a4 1 parent fa8aac9
Dan Grossman authored February 09, 2012

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  public/js/views/BookmarksView.js
4  public/js/views/BookmarksView.js
@@ -68,6 +68,8 @@ var BookmarksView = Backbone.View.extend({
68 68
         if (bottom) {
69 69
             $(window).unbind('scroll');
70 70
             $.getJSON('/json/bookmark?offset=' + self.offset, function(data) {
  71
+                self.collection.unbind('add');
  72
+
71 73
                 self.offset += 50;
72 74
                 self.collection.add(data);
73 75
                 
@@ -78,6 +80,8 @@ var BookmarksView = Backbone.View.extend({
78 80
                 });
79 81
                 
80 82
                 $(window).scroll(function() { self.scroll(); });
  83
+
  84
+                self.collection.bind('add', self.render, self);
81 85
             });
82 86
         }
83 87
     }

0 notes on commit 7dbea0d

Please sign in to comment.
Something went wrong with that request. Please try again.