make stream infininte scroll view static method on the page
This commit is contained in:
parent
a9288daf19
commit
a7ced3f77b
1 changed files with 13 additions and 10 deletions
|
|
@ -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({
|
app.pages.Stream = app.views.Base.extend({
|
||||||
templateName : "stream",
|
templateName : "stream",
|
||||||
|
|
||||||
|
|
@ -23,7 +14,7 @@ app.pages.Stream = app.views.Base.extend({
|
||||||
this.stream = this.model = new app.models.Stream()
|
this.stream = this.model = new app.models.Stream()
|
||||||
this.stream.preloadOrFetch()
|
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()
|
var interactions = this.interactionsView = new app.views.StreamInteractions()
|
||||||
|
|
||||||
this.stream.on("frame:interacted", function(post){
|
this.stream.on("frame:interacted", function(post){
|
||||||
|
|
@ -65,4 +56,16 @@ app.pages.Stream = app.views.Base.extend({
|
||||||
refreshScrollSpy : function(){
|
refreshScrollSpy : function(){
|
||||||
_.defer($('body').scrollspy('refresh'))
|
_.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()
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue