From 0960a090fa8278f326d15ae5d0f150e67e503410 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Mon, 21 May 2012 11:09:33 -0700 Subject: [PATCH] actually use the computed image height; remove unused presenter --- app/assets/javascripts/app/views/canvas_frame.js | 1 + app/assets/javascripts/app/views/canvas_view.js | 6 +++--- app/assets/javascripts/app/views/small_frame.js | 4 ---- app/assets/templates/small-frame/default.jst.hbs | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/app/views/canvas_frame.js b/app/assets/javascripts/app/views/canvas_frame.js index 5f8ab9589..99ca7d4ff 100644 --- a/app/assets/javascripts/app/views/canvas_frame.js +++ b/app/assets/javascripts/app/views/canvas_frame.js @@ -26,6 +26,7 @@ app.views.CanvasFrame = app.views.SmallFrame.extend({ }, presenter : function(){ + console.log(this.adjustedImageHeight()) return _.extend(this.smallFramePresenter(), { adjustedImageHeight : this.adjustedImageHeight() }) diff --git a/app/assets/javascripts/app/views/canvas_view.js b/app/assets/javascripts/app/views/canvas_view.js index 6a6df3b17..9ab178228 100644 --- a/app/assets/javascripts/app/views/canvas_view.js +++ b/app/assets/javascripts/app/views/canvas_view.js @@ -39,9 +39,9 @@ app.views.Canvas = app.views.Base.extend(_.extend({}, app.views.infiniteScrollMi 1) on dom ready 2) on images ready */ - triggerIsotope(el) && el.imagesLoaded(function(){ - triggerIsotope(el) - }) + triggerIsotope(el) && el.imagesLoaded(_.bind(function(){ + this.reLayout() + },this)) function triggerIsotope(element) { return element.isotope({ diff --git a/app/assets/javascripts/app/views/small_frame.js b/app/assets/javascripts/app/views/small_frame.js index a05106579..6aa8b31ef 100644 --- a/app/assets/javascripts/app/views/small_frame.js +++ b/app/assets/javascripts/app/views/small_frame.js @@ -19,10 +19,6 @@ app.views.SmallFrame = app.views.Post.extend({ return new app.views.OEmbed({model : this.model}) }, - presenter : function(){ - return this.smallFramePresenter() - }, - smallFramePresenter : function(){ //todo : we need to have something better for small frame text, probably using the headline() scenario. return _.extend(this.defaultPresenter(), diff --git a/app/assets/templates/small-frame/default.jst.hbs b/app/assets/templates/small-frame/default.jst.hbs index c94a59ea9..01f6f32dd 100644 --- a/app/assets/templates/small-frame/default.jst.hbs +++ b/app/assets/templates/small-frame/default.jst.hbs @@ -2,7 +2,7 @@ {{#if photos}}
{{#each photos}} - + {{/each}}
{{/if}}