diaspora/app/assets/javascripts/app/views/stream_view.js
Dennis Collinson 062de4c269 MDC DC New Profile shows users info
Profile show json
Profile backbone model
2012-04-21 13:12:56 -07:00

27 lines
727 B
JavaScript

app.views.Stream = Backbone.View.extend(_.extend( app.views.infiniteScrollMixin, {
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() })
}
}
}));