From e84635dae21ea68e7f31e519b7743315bfeb19b8 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Sun, 10 Jul 2011 17:03:38 -0700 Subject: [PATCH] constrain in the image uploader, don't crop --- app/uploaders/processed_image.rb | 4 ++-- app/views/photos/_index.html.haml | 14 +------------- public/stylesheets/sass/application.sass | 15 +++++++-------- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/app/uploaders/processed_image.rb b/app/uploaders/processed_image.rb index a2e8c3658..56194f888 100644 --- a/app/uploaders/processed_image.rb +++ b/app/uploaders/processed_image.rb @@ -21,10 +21,10 @@ class ProcessedImage < CarrierWave::Uploader::Base process :resize_to_fill => [50,50] end version :thumb_medium do - process :resize_to_fill => [100,100] + process :resize_to_limit => [100,100] end version :thumb_large do - process :resize_to_fill => [300,300] + process :resize_to_limit => [300,300] end version :scaled_full do diff --git a/app/views/photos/_index.html.haml b/app/views/photos/_index.html.haml index bc38eeca3..71964c6be 100644 --- a/app/views/photos/_index.html.haml +++ b/app/views/photos/_index.html.haml @@ -3,19 +3,7 @@ -# the COPYRIGHT file. -- content_for :head do - :javascript - $(document).ready(function(){ - $("#thumbnails").find("img").bind("mouseenter",function(){ - var photo = $(this), - messageId = photo.attr("data-message-id"); - - $("#thumbnails").find("img[data-message-id='"+messageId+"']").css('opacity','0.5'); - $("#thumbnails").find("img").fadeTo(100,1); - }); - }); - #thumbnails.span-15.last - for photo in photos - = link_to (image_tag photo.url(:thumb_medium), "data-message-guid" => photo.status_message_guid ), photo_path(photo) + = link_to (image_tag photo.url(:thumb_large), "data-message-guid" => photo.status_message_guid ), photo_path(photo) diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index ccfdfee8b..efb9fc0d3 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1054,17 +1054,16 @@ img.scaled_full #thumbnails a :display inline-block - :width 100px - :min-width 100px - :height 100px - :min-height 100px + :height 125px :margin - :bottom 15px - :right 15px + :bottom 8px + :right 2px + :vertical-align middle + :background + :color red img - :height 100px - :width 100px + :max-height 125px #global_search :display inline