From cf62c91ee0bb85da7750eb65117fe07979af0df6 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Fri, 21 Oct 2011 12:01:48 -0500 Subject: [PATCH] Wrap the project name in a div tag inside the h2 tag When using inline editing of the project name, the extra stuff that's in the template for a collapsible project adds a bunch of spaces to the beginning of the project name due to how the editable plugin is getting the text for the selector it's being asked to edit. Using the div tag inside the header tag, and adjusting the javascript to use the div#project_name selector fixes this behavior and fixes #1204 --- app/views/projects/_project.rhtml | 5 +++-- public/javascripts/application.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/projects/_project.rhtml b/app/views/projects/_project.rhtml index b2f4ec8f..082ed641 100644 --- a/app/views/projects/_project.rhtml +++ b/app/views/projects/_project.rhtml @@ -1,9 +1,10 @@
-

+

<% if collapsible -%> <%= image_tag("collapse.png") %> <% end -%> - <%= project.name -%>

+
<%= project.name -%>
+
" class="list"><%-# list needs to be here for edit form to work -%> <%= render :partial => "projects/project_settings", :object => project, :locals => { :collapsible => collapsible } %>
diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 1998be67..280bf6bf 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -734,8 +734,8 @@ var ProjectListPage = { }, setup_behavior: function() { /* in-place edit of project name */ - $('h2#project_name').editable(ProjectListPage.save_project_name, { - style: 'padding:0px', + $('div#project_name').editable(ProjectListPage.save_project_name, { + style: 'padding: 0px; width=100%;', submit: i18n['common.ok'], cancel: i18n['common.cancel'] });