From b6dc32959ca16122f3362f67f454aa2926a9f856 Mon Sep 17 00:00:00 2001 From: Michael Nutt Date: Sun, 27 Feb 2011 02:04:43 -0500 Subject: [PATCH] place thumbnails inside status message form and add spacing --- app/views/photos/_new_photo.haml | 5 ++++- public/javascripts/publisher.js | 2 +- public/javascripts/stream.js | 2 +- public/stylesheets/sass/application.sass | 7 ++++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/views/photos/_new_photo.haml b/app/views/photos/_new_photo.haml index 1f8f9fc62..b99263a32 100644 --- a/app/views/photos/_new_photo.haml +++ b/app/views/photos/_new_photo.haml @@ -46,12 +46,13 @@ $('#new_status_message').append(""); $('#photodropzone').append( "
  • " + - "" + + "" + "
    X
    " + "
    " + "
  • " ); $('#publisher').find("input[type='submit']").removeAttr('disabled'); + $("#publisher textarea").css('paddingBottom', $("#photodropzone").height() + 10); $('.x').live('click', function(){ var photo = $(this).closest('.publisher_photo'); photo.addClass("dim"); @@ -60,8 +61,10 @@ success: function() { photo.fadeOut(400, function(){ photo.remove(); + $("#publisher textarea").css('paddingBottom', $("#photodropzone").height() + 10); if ( $('.publisher_photo').length == 0){ $("#publisher textarea").removeClass("with_attachments"); + $("#publisher textarea").css('paddingBottom', ''); } }); } diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index 5616eab57..8b711c311 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -281,7 +281,7 @@ var Publisher = { clear: function(){ this.autocompletion.mentionList.clear(); $("#photodropzone").find('li').remove(); - $("#publisher textarea").removeClass("with_attachments"); + $("#publisher textarea").removeClass("with_attachments").css('paddingBottom', ''); }, bindServiceIcons: function(){ $(".service_icon").bind("click", function(evt){ diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index fc2390494..67daae24f 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -48,7 +48,7 @@ var Stream = { $(".new_status_message").live('ajax:loading', function(data, json, xhr) { $("#photodropzone").find('li').remove(); - $("#publisher textarea").removeClass("with_attachments"); + $("#publisher textarea").removeClass("with_attachments").css('paddingBottom', ''); }); $(".new_status_message").live('ajax:success', function(data, json, xhr) { diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 5dac6e9b4..2af5d5534 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -869,7 +869,7 @@ label input :display inline - + .right :top 2px @@ -972,8 +972,13 @@ label :z-index 3 :position absolute :bottom 0 + :width 435px :left 5px li + :margin-right 4px + img + :height 50px + :width 50px .circle :display none :z-index 1