Permalink
Browse files

fix extract scroll offset to variable

  • Loading branch information...
1 parent 632ed12 commit 4738e12da30552d4632eeaad1c78d4070a4fa101 @denniscollective denniscollective committed Jul 3, 2012
View
2 app/assets/javascripts/app/views/canvas_view.js
@@ -1,4 +1,6 @@
app.views.Canvas = app.views.InfScroll.extend({
+ scrollOffset : 500,
+
initialize: function(){
this.stream = this.model
this.collection = this.stream.items
View
4 app/assets/javascripts/app/views/infinite_stream_view.js
@@ -7,6 +7,8 @@
// a call to setupInfiniteScroll
app.views.InfScroll = app.views.Base.extend({
+ scrollOffset : 2000,
+
setupInfiniteScroll : function() {
this.postViews = this.postViews || []
@@ -68,7 +70,7 @@ app.views.InfScroll = app.views.Base.extend({
var $window = $(window)
, distFromTop = $window.height() + $window.scrollTop()
, distFromBottom = $(document).height() - distFromTop
- , bufferPx = 2000;
+ , bufferPx = this.scrollOffset;
if(distFromBottom < bufferPx) {
this.trigger("loadMore")

0 comments on commit 4738e12

Please sign in to comment.