Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #2906 from Raven24/fix-2770

fix for #2770
  • Loading branch information...
commit 76450f7882e2e76fd839b3cb17de677756bc1820 2 parents d211272 + 7c73a52
Maxwell Salzberg maxwell authored
8 app/views/photos/_new_photo.haml
@@ -29,7 +29,7 @@
29 29 $('#file-upload').addClass("loading");
30 30 $('#publisher').find("input[type='submit']").attr('disabled','disabled');
31 31
32   - $("#publisher textarea").addClass("with_attachments");
  32 + Publisher.wrapper().addClass("with_attachments");
33 33 $('#photodropzone').append(
34 34 "<li class='publisher_photo loading' style='position:relative;'>" +
35 35 "<img src='/images/ajax-loader2.gif' />" +
@@ -43,7 +43,7 @@
43 43 url = responseJSON.data.photo.unprocessed_image.url,
44 44 currentPlaceholder = $('li.loading').first();
45 45
46   - $("#publisher textarea").addClass("with_attachments");
  46 + Publisher.wrapper().addClass("with_attachments");
47 47 $('#new_status_message').append("<input type='hidden' value='" + id + "' name='photos[]' />");
48 48
49 49 // replace image placeholders
@@ -68,10 +68,8 @@
68 68 success: function() {
69 69 photo.fadeOut(400, function(){
70 70 photo.remove();
71   - textarea.css('paddingBottom', $("#photodropzone").height() + 10);
72 71 if ( $('.publisher_photo').length == 0){
73   - textarea.removeClass("with_attachments");
74   - textarea.css('paddingBottom', '');
  72 + Publisher.wrapper().removeClass("with_attachments");
75 73 }
76 74 });
77 75 }
8 public/javascripts/app/views/publisher_view.js
@@ -8,7 +8,7 @@ app.views.Publisher = Backbone.View.extend({
8 8
9 9 events : {
10 10 "focus textarea" : "open",
11   - "click #hide_publisher" : "close",
  11 + "click #hide_publisher" : "clear",
12 12 "submit form" : "createStatusMessage"
13 13 },
14 14
@@ -48,10 +48,8 @@ app.views.Publisher = Backbone.View.extend({
48 48 },
49 49
50 50 clear : function() {
51   - this.$('textarea')
52   - .removeClass("with_attachments")
53   - .css("paddingBottom", "")
54   - .val("");
  51 + this.$('textarea').val("");
  52 + this.$('#publisher_textarea_wrapper').removeClass("with_attachments");
55 53
56 54 // remove photos
57 55 this.$("#photodropzone").find('li').remove();
18 public/javascripts/publisher.js
@@ -15,6 +15,10 @@ var Publisher = {
15 15 return Publisher.cachedInput = Publisher.cachedInput || Publisher.form().find('#status_message_fake_text');
16 16 },
17 17
  18 + wrapper: function(){
  19 + return Publisher.cachedWrapper = Publisher.cachedWrapper || Publisher.form().find('#publisher_textarea_wrapper');
  20 + },
  21 +
18 22 hiddenInput: function(){
19 23 return Publisher.cachedHiddenInput= Publisher.cachedHiddenInput || Publisher.form().find('#status_message_text');
20 24 },
@@ -37,10 +41,8 @@ var Publisher = {
37 41
38 42 clear: function(){
39 43 $("#photodropzone").find('li').remove();
40   - Publisher.input()
41   - .removeClass("with_attachments")
42   - .css('paddingBottom', '')
43   - .mentionsInput("reset");
  44 + Publisher.input().mentionsInput("reset");
  45 + Publisher.wrapper().removeClass("with_attachments");
44 46 },
45 47
46 48 bindServiceIcons: function(){
@@ -196,14 +198,6 @@ var Publisher = {
196 198 Publisher.bindServiceIcons();
197 199 Publisher.bindAspectToggles();
198 200
199   - /* close text area */
200   - Publisher.form().delegate("#hide_publisher", "click", function(){
201   - $.each(Publisher.form().find("textarea"), function(idx, element){
202   - $(element).val("");
203   - });
204   - Publisher.close();
205   - });
206   -
207 201 Mentions.initialize(Publisher.input());
208 202
209 203 Publisher.input().bind("focus", function(){
6 public/stylesheets/sass/application.sass
@@ -839,9 +839,8 @@ form p.checkbox_select
839 839 :outline 0
840 840 :background transparent
841 841
842   - &.with_attachments
843   - :padding
844   - :bottom 70px
  842 + &.with_attachments
  843 + :padding-bottom 38px
845 844
846 845 #photodropzone
847 846 :z-index 3
@@ -856,6 +855,7 @@ form p.checkbox_select
856 855 :margin-right 4px
857 856 img
858 857 :width 50px
  858 + :max-height 55px
859 859 .circle
860 860 @include border-radius(20px)
861 861

0 comments on commit 76450f7

Please sign in to comment.
Something went wrong with that request. Please try again.