diff --git a/app/views/users/getting_started.haml b/app/views/users/getting_started.haml index f2f0e4e4cb9bf62894b73656c1029b189630f9f8..b678a8808ca3e0f6c316bb3d1ab4fd18b4dc218a 100644 --- a/app/views/users/getting_started.haml +++ b/app/views/users/getting_started.haml @@ -82,10 +82,8 @@ = text_field_tag 'profile[first_name]', current_user.person.profile.first_name, :placeholder => t('profiles.edit.first_name') = image_tag 'ajax-loader.gif', :id => "form_spinner", :class => "hidden" %span.saved{:class => "hidden"} - Saved! - - /%br - /= submit_tag "Save" + = image_tag 'icons/check_yes_ok.png' + = t(".saved") .span-7.last = render 'photos/new_profile_photo', :aspect => :getting_started, :person => current_user.person diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 9b161d7f6c8091d7000067412116013c63a946f3..1333da7f874aba4ce0b3e2c78e73e6ec230ea2c5 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -903,6 +903,8 @@ en: what_are_you_in_to: "What are you in to?" hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They're also a great way to find new people on Diaspora." + saved: "Saved!" + update: password_changed: "Password changed. You can now log in with your new password." password_not_changed: "Password change failed" diff --git a/public/javascripts/pages/users-getting-started.js b/public/javascripts/pages/users-getting-started.js index 043b2f2c3bfa7765162b67123e01698488dfb0d1..8f1edf9a73e31017f889c8281424069a46de51e5 100644 --- a/public/javascripts/pages/users-getting-started.js +++ b/public/javascripts/pages/users-getting-started.js @@ -5,14 +5,25 @@ Diaspora.Pages.UsersGettingStarted = function() { self.peopleSearch = self.instantiate("Search", body.find("form.people.search_form")); self.tagSearch = self.instantiate("Search", body.find("form.tag_input.search_form")); + $('#edit_profile').bind('ajax:success', function(evt, data, status, xhr){ + $('#form_spinner').addClass("hidden"); + $('.profile .saved').show(); + $('.profile .saved').fadeOut(2000); + }); + + // It seems that the default behavior of rails ujs is to clear the remote form + $('#edit_profile').bind('ajax:complete', function(evt, xhr, status){ + var firstNameField = $("#profile_first_name"); + firstNameField.val(firstNameField.data("cachedValue")); + }); + + + $("#profile_first_name").bind("change", function(){ - $('#edit_profile').bind('ajax:success', function(evt, data, status, xhr){ - $('#form_spinner').addClass("hidden"); - $('.profile .saved').removeClass("hidden"); - $('.profile .saved').fadeOut(2000); - }); + $(this).data("cachedValue", $(this).val()); $('#edit_profile').submit(); $('#form_spinner').removeClass("hidden"); + }); }); }; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 5b3da87b445730fa83d0badafc00774005e900f9..9a7bdfa0da76ef74c1f13a78616b9924557aa319 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -3230,6 +3230,13 @@ ul#getting_started .button :top 20px + .saved + img + :position relative + :top 4px + :right 2px + + #right_service_icons :text-align center :padding 10px