]> source.dussan.org Git - redmine.git/commitdiff
Prevent text wrap in gantt subjects (#7280).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 21 Feb 2011 15:06:11 +0000 (15:06 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 21 Feb 2011 15:06:11 +0000 (15:06 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4913 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/gantts/show.html.erb
lib/redmine/helpers/gantt.rb

index 33220eea913c721ebd336ca92b7f7076e63bcf49..1e38647ee8bf11c4775bada170624ec7e9c1942a 100644 (file)
@@ -60,7 +60,7 @@ end
 # Width of the entire chart    
 g_width = (@gantt.date_to - @gantt.date_from + 1)*zoom
 
-@gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width)
+@gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width, :subject_width => subject_width)
 
 g_height = [(20 * (@gantt.number_of_rows + 6))+150, 206].max
 t_height = g_height + headers_height
index b0d722906db77f03481071edb0cf562607b101f8..d4492ec6823f7bd4e62e651c66b684d20982d1b2 100644 (file)
@@ -709,7 +709,10 @@ module Redmine
       end
       
       def html_subject(params, subject, options={})
-        output = "<div class=' #{options[:css] }' style='position: absolute;line-height:1.2em;height:16px;top:#{params[:top]}px;left:#{params[:indent]}px;overflow:hidden;'>"
+        style = "position: absolute;line-height:1.2em;height:16px;top:#{params[:top]}px;left:#{params[:indent]}px;overflow:hidden;white-space:nowrap;text-overflow: ellipsis;"
+        style << "width:#{params[:subject_width] - params[:indent]}px;" if params[:subject_width]
+        
+        output = "<div class='#{options[:css]}' style='#{style}'>"
         output << subject
         output << "</div>"
         @subjects << output