diff --git a/app/views/projects/update.js.rjs b/app/views/projects/update.js.rjs index a8b4d3a8..2d554dea 100644 --- a/app/views/projects/update.js.rjs +++ b/app/views/projects/update.js.rjs @@ -28,5 +28,9 @@ else page << "defaultTags = #{default_tags_for_autocomplete};" end -page.replace_html "sidebar", :file => 'sidebar/sidebar.html.erb' +page['default_project_name_id'].value = @project.name +page['todo_project_name'].value = @project.name +page.replace_html "project_name", @project.name +page.replace_html "sidebar", :file => 'sidebar/sidebar.html.erb' +page << "enable_rich_interaction();" diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb index bb200f1a..9ec28edc 100644 --- a/features/step_definitions/project_steps.rb +++ b/features/step_definitions/project_steps.rb @@ -30,7 +30,10 @@ end When /^I edit the project name to "([^\"]*)"$/ do |new_title| click_link "link_edit_project_#{@project.id}" fill_in "project[name]", :with => new_title - click_button "submit_project_#{@project.id}" + selenium.click "submit_project_#{@project.id}", + :wait_for => :text, + :element => "flash", + :text => "Project saved" end Then /^I should see the bold text "([^\"]*)" in the project description$/ do |bold| diff --git a/public/javascripts/application.js b/public/javascripts/application.js index e607f777..30d836f5 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -273,6 +273,8 @@ function enable_rich_interaction(){ /* Reset auto updater */ field_touched = false; + + $('h2#project_name').editable(save_project_name, {style: 'padding:0px', submit: "OK"}); } /* Auto-refresh */ @@ -462,8 +464,6 @@ $(document).ready(function() { return(value); }; - $('h2#project_name').editable(save_project_name, {style: 'padding:0px', submit: "OK"}); - $('.alphabetize_link').click(function(evt){ evt.preventDefault(); if(confirm('Are you sure that you want to sort these projects alphabetically? This will replace the existing sort order.')){