Odd rendering of month/year in 1.4 #77

errantpixel opened this Issue Jul 10, 2012 · 1 comment

1 participant


Moving my redmine installation up to the 1.4 branch and put the latest version of this plugin in as well and am now seeing an odd render issue in the month/year table along the top. It's consistent whichever theme I choose, so it doesn't appear to be theme related. Its as if the divs are getting stacked on top of one another.

Screenshot here:


Any pointers?


Looking closer, it appears the style of div is getting fractions inserted

<div style="left:248/1px;width:247/1px;height:18px;" class="gantt_hdr">
    <a href="/projects/demo/issues/gantt?month=8&amp;months=6&amp;year=2012&amp;zoom=3" title="August 2012">2012-8</a>

This is only occuring to the months headers, relevant snippet of show.html.erb

# Months headers
month_f = @gantt.date_from
left = 0
height = (show_weeks ? header_heigth : header_heigth + g_height)
@gantt.months.times do
        width = ((month_f >> 1) - month_f) * zoom - 1
        <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
        <%= link_to "#{month_f.year}-#{month_f.month}", @gantt.params.merge(:year => month_f.year, :month => month_f.month), :title => "#{month_name(month_f.month)} #{month_f.year}"%>
        left = left + width + 1
        month_f = month_f >> 1
end %>

I can't see where the fractional result for both left and width could be coming in to play.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment