From b4ca14ade4058b5d75b1e40b07df259a32623d2b Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Fri, 20 Apr 2012 18:31:38 -0700 Subject: [PATCH] DG MS; clicking a post in the profile goes to the show page. --- app/assets/javascripts/app/views/canvas_view.js | 2 +- app/assets/javascripts/app/views/small_frame.js | 10 ++++++++-- app/assets/stylesheets/new_styles/_canvas.scss | 10 ++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/views/canvas_view.js b/app/assets/javascripts/app/views/canvas_view.js index 1ca7ad340..553c0119c 100644 --- a/app/assets/javascripts/app/views/canvas_view.js +++ b/app/assets/javascripts/app/views/canvas_view.js @@ -8,7 +8,7 @@ app.views.Canvas = app.views.Base.extend(_.extend(app.views.infiniteScrollMixin, renderTemplate : function() { this.postRenderTemplate(); - setTimeout(_.bind(this.mason, this), 1000) + setTimeout(_.bind(this.mason, this), 1000) }, mason : function() { diff --git a/app/assets/javascripts/app/views/small_frame.js b/app/assets/javascripts/app/views/small_frame.js index f112eebf0..2153641c7 100644 --- a/app/assets/javascripts/app/views/small_frame.js +++ b/app/assets/javascripts/app/views/small_frame.js @@ -4,6 +4,10 @@ app.views.SmallFrame = app.views.Base.extend({ templateName : "small-frame", + events : { + "click .content" : "goToPost" + }, + postRenderTemplate : function() { this.$el.addClass(this.photoClass() + ' ' + this.textClass()) }, @@ -36,7 +40,9 @@ app.views.SmallFrame = app.views.Base.extend({ } else { return baseClass + 'many' } + }, + + goToPost : function() { + app.router.navigate(this.model.url(), true) } - - }); \ No newline at end of file diff --git a/app/assets/stylesheets/new_styles/_canvas.scss b/app/assets/stylesheets/new_styles/_canvas.scss index c28327127..cfa880b34 100644 --- a/app/assets/stylesheets/new_styles/_canvas.scss +++ b/app/assets/stylesheets/new_styles/_canvas.scss @@ -26,8 +26,18 @@ body { //clear : both; // here for testing! .content { + @include transition(box-shadow); @include box-shadow(0,1px,3px,rgba(0,0,0,0.2)); + &:hover { + @include box-shadow(0,1px,3px,rgba(0,0,0,0.5)); + cursor : pointer; + } + + &:active { + -webkit-transform : scale(0.98); + } + position : relative; background-color : #fff;