Loading app/assets/javascripts/app/views/infinite_stream_view.js +2 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,8 @@ app.views.InfScroll = app.views.Base.extend({ infScroll : function() { var $window = $(window), distFromBottom = $(document).height() - $window.height() - $window.scrollTop(), elementDistance = this.$el.children().last().offset().top - $window.scrollTop() - 500; lastElOffset = this.$el.children().last().offset(), elementDistance = lastElOffset ? lastElOffset.top - $window.scrollTop() - 500 : 1; if(elementDistance <= 0 || distFromBottom < 500) { this.trigger("loadMore"); Loading Loading
app/assets/javascripts/app/views/infinite_stream_view.js +2 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,8 @@ app.views.InfScroll = app.views.Base.extend({ infScroll : function() { var $window = $(window), distFromBottom = $(document).height() - $window.height() - $window.scrollTop(), elementDistance = this.$el.children().last().offset().top - $window.scrollTop() - 500; lastElOffset = this.$el.children().last().offset(), elementDistance = lastElOffset ? lastElOffset.top - $window.scrollTop() - 500 : 1; if(elementDistance <= 0 || distFromBottom < 500) { this.trigger("loadMore"); Loading