From 0cb9f1c0d7c089b8ec3d84638d19a7f19328e5d3 Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Tue, 18 Jan 2011 10:46:15 -0800 Subject: [PATCH] focus publisher on reshare --- app/views/shared/_publisher.haml | 1 + app/views/shared/_publisher.mobile.haml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index d6f2873e6..2da537dfb 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -22,6 +22,7 @@ #publisher_textarea_wrapper %ul#photodropzone = status.text_area :message, :rows => 2, :value => h(params[:prefill]) + = javascript_tag "if ($('textarea#status_message_message').val() != ''){ $('textarea#status_message_message').focus();}" - for aspect_id in @aspect_ids = hidden_field_tag 'aspect_ids[]', aspect_id.to_s diff --git a/app/views/shared/_publisher.mobile.haml b/app/views/shared/_publisher.mobile.haml index 2752cf0a7..a6536377d 100644 --- a/app/views/shared/_publisher.mobile.haml +++ b/app/views/shared/_publisher.mobile.haml @@ -7,7 +7,8 @@ = form_for StatusMessage.new, :remote => true do |status| %p = status.label :message, t('.post_a_message_to', :aspect => (aspect == :all ? t('.all') : aspect)) - = status.text_area :message, :rows => 2, :value => params[:prefill] + = status.text_area :message, :rows => 2, :value => h(params[:prefill]) + = javascript_tag "if ($('textarea#status_message_message').val() != ''){ $('textarea#status_message_message').focus();}" = status.hidden_field :to, :value => (aspect == :all ? aspect : aspect.id)