Refactor: extract gantt zoom links to a helper.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3756 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -233,4 +233,26 @@ module IssuesHelper
|
||||
end
|
||||
export
|
||||
end
|
||||
|
||||
def gantt_zoom_link(gantt, in_or_out)
|
||||
case in_or_out
|
||||
when :in
|
||||
if gantt.zoom < 4
|
||||
link_to_remote(image_tag('zoom_in.png'),
|
||||
{:url => gantt.params.merge(:zoom => (gantt.zoom+1)), :update => 'content'},
|
||||
{:href => url_for(gantt.params.merge(:zoom => (gantt.zoom+1)))})
|
||||
else
|
||||
image_tag('zoom_in_g.png')
|
||||
end
|
||||
|
||||
when :out
|
||||
if gantt.zoom > 1
|
||||
link_to_remote(image_tag('zoom_out.png'),
|
||||
{:url => gantt.params.merge(:zoom => (gantt.zoom-1)), :update => 'content'},
|
||||
{:href => url_for(gantt.params.merge(:zoom => (gantt.zoom-1)))})
|
||||
else
|
||||
image_tag('zoom_out_g.png')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user