diaspora/app/assets/javascripts/app/views/stream_view.js
danielgrippi e379a6df0f Merge branch 'master' into stream-for-photos
Conflicts:
	app/assets/javascripts/app/views/stream_view.js
2012-04-18 18:30:54 -07:00

27 lines
726 B
JavaScript

app.views.Stream = Backbone.View.extend(_.extend({
initialize: function(options) {
this.stream = this.model
this.collection = this.stream.items
this.postViews = []
this.setupNSFW()
this.setupLightbox()
this.setupInfiniteScroll()
},
postClass : app.views.StreamPost,
setupLightbox : function(){
this.lightbox = Diaspora.BaseWidget.instantiate("Lightbox");
this.$el.delegate("a.stream-photo-link", "click", this.lightbox.lightboxImageClicked);
},
setupNSFW : function(){
app.currentUser.bind("nsfwChanged", reRenderPostViews, this)
function reRenderPostViews() {
_.map(this.postViews, function(view){ view.render() })
}
}
}, app.views.infiniteScrollMixin));