From 39f596462e39412ac0d7868c56e5e253ef98d3f7 Mon Sep 17 00:00:00 2001 From: maxwell Date: Sat, 20 Nov 2010 11:57:55 -0800 Subject: [PATCH] saying sent on requests via js --- app/views/requests/_new_request_to_person.haml | 11 +++++++---- public/javascripts/view.js | 7 +++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/views/requests/_new_request_to_person.haml b/app/views/requests/_new_request_to_person.haml index 0f380e533..b1fbee6c9 100644 --- a/app/views/requests/_new_request_to_person.haml +++ b/app/views/requests/_new_request_to_person.haml @@ -2,7 +2,10 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -= form_for(Request.new, :remote => true ) do |request| - = request.select(:into, options_from_collection_for_select(aspects, "id", "name")) - = request.hidden_field :to, :value => destination_handle - = request.submit t('people.person.add_contact'), :disable_with => t('requests.create.sending') +%div{:id => destination_handle} + = form_for(Request.new, :remote => true ) do |request| + = request.select(:into, options_from_collection_for_select(aspects, "id", "name")) + = request.hidden_field :to, :value => destination_handle + = request.submit t('people.person.add_contact'), :disable_with => t('requests.create.sending') + .message.hidden + %i sent! diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 8638ad64e..d189fb757 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -37,6 +37,13 @@ $(document).ready(function(){ } ); + $('.new_request').submit(function(){ + var foo = $(this).parent(); + $(this).hide(); + foo.find('.message').removeClass('hidden'); + }); + + $("#q").blur( function() { $(this).removeClass('active');