diff --git a/app/assets/javascripts/app/pages/stream.js b/app/assets/javascripts/app/pages/stream.js index 29028393b..94ccb4ece 100644 --- a/app/assets/javascripts/app/pages/stream.js +++ b/app/assets/javascripts/app/pages/stream.js @@ -1,12 +1,3 @@ -app.views.NewStream = app.views.InfScroll.extend({ - initialize: function(){ - this.stream = this.model - this.collection = this.stream.items - this.postClass = app.views.Post.StreamFrame - this.setupInfiniteScroll() - } -}); - app.pages.Stream = app.views.Base.extend({ templateName : "stream", @@ -23,7 +14,7 @@ app.pages.Stream = app.views.Base.extend({ this.stream = this.model = new app.models.Stream() this.stream.preloadOrFetch() - this.streamView = new app.views.NewStream({ model : this.stream }) + this.streamView = new app.pages.Stream.InfiniteScrollView({ model : this.stream }) var interactions = this.interactionsView = new app.views.StreamInteractions() this.stream.on("frame:interacted", function(post){ @@ -65,4 +56,16 @@ app.pages.Stream = app.views.Base.extend({ refreshScrollSpy : function(){ _.defer($('body').scrollspy('refresh')) } +}, + +//static methods +{ + InfiniteScrollView : app.views.InfScroll.extend({ + initialize: function(){ + this.stream = this.model + this.collection = this.stream.items + this.postClass = app.views.Post.StreamFrame + this.setupInfiniteScroll() + } + }) });