diff --git a/app/assets/javascripts/app/pages/post-viewer.js b/app/assets/javascripts/app/pages/post-viewer.js index c932bd43c..2cd303ce1 100644 --- a/app/assets/javascripts/app/pages/post-viewer.js +++ b/app/assets/javascripts/app/pages/post-viewer.js @@ -1,5 +1,4 @@ app.pages.PostViewer = app.views.Base.extend({ - templateName: "post-viewer", subviews : { @@ -92,5 +91,4 @@ app.pages.PostViewer = app.views.Base.extend({ if(evt.keyCode != 27) { return } this.interactionsView.hidePane(); } - }); diff --git a/app/assets/javascripts/app/pages/profile.js b/app/assets/javascripts/app/pages/profile.js index d3a809834..923859737 100644 --- a/app/assets/javascripts/app/pages/profile.js +++ b/app/assets/javascripts/app/pages/profile.js @@ -1,35 +1,19 @@ //= require ../views/small_frame -app.pages.Profile = app.views.Base.extend(_.extend(app.views.infiniteScrollMixin, { +app.pages.Profile = app.views.Base.extend({ templateName : "profile", -// subviews : { -// "#canvas" : "canvasView" -// }, + subviews : { + "#canvas" : "canvasView" + }, initialize : function(options) { this.model = new app.models.Profile.findByGuid(options.personId) this.stream = options && options.stream || new app.models.Stream() - this.collection = this.stream.posts this.stream.fetch(); + this.model.bind("change", this.render, this) //this should go on profile info view when it gets Extracted - this.model.bind("change", this.render, this) - -// this.initViews() - -// this.setupInfiniteScroll() - }, - - postClass : app.views.SmallFrame, - -// mason : function() { -// this.$el.isotope({ -// itemSelector : '.canvas-frame' -// }) -// } - -// initViews : function() { -// this.canvasView = new app.views.Canvas({model : this.model}) -// } -})); \ No newline at end of file + this.canvasView = new app.views.Canvas({model : this.stream}) + } +}); \ No newline at end of file diff --git a/app/assets/javascripts/app/views/canvas_view.js b/app/assets/javascripts/app/views/canvas_view.js index b17454418..48b50b388 100644 --- a/app/assets/javascripts/app/views/canvas_view.js +++ b/app/assets/javascripts/app/views/canvas_view.js @@ -1,14 +1,17 @@ -app.views.Canvas = app.views.Base.extend({ - - templateName : 'canvas', - - postRenderTemplate : function() { - setTimeout(_.bind(this.mason, this), 0) - }, - - mason : function() { - this.$el.isotope({ - itemSelector : '.canvas-frame' - }) +app.views.Canvas = app.views.Base.extend(_.extend(app.views.infiniteScrollMixin, { + initialize: function(){ + this.stream = this.model + this.collection = this.stream.items + this.postClass = app.views.SmallFrame, + this.setupInfiniteScroll() } -}) +// renderTemplate : function() { +// setTimeout(_.bind(this.mason, this), 1000) +// }, +// +// mason : function() { +// this.$el.isotope({ +// itemSelector : '.canvas-frame' +// }) +// } +})) diff --git a/app/assets/templates/profile.jst.hbs b/app/assets/templates/profile.jst.hbs index d0c158e13..6ccd2ee4b 100644 --- a/app/assets/templates/profile.jst.hbs +++ b/app/assets/templates/profile.jst.hbs @@ -1,11 +1,15 @@ -