Commit d8479898 authored by maeda's avatar maeda
Browse files

Make gantt columns resizable (#20481).

Contributed by Mizuki ISHIKAWA.


git-svn-id: https://svn.redmine.org/redmine/trunk@17026 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent ac005f3c
......@@ -137,7 +137,6 @@
<%= content_tag(:div, :style => style, :class => "gantt_subjects_container") do %>
<%
style = ""
style += "right:-2px;"
style += "width: #{subject_width}px;"
style += "height: #{headers_height}px;"
style += 'background: #eee;'
......@@ -145,7 +144,6 @@
<%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %>
<%
style = ""
style += "right:-2px;"
style += "width: #{subject_width}px;"
style += "height: #{t_height}px;"
style += 'border-left: 1px solid #c0c0c0;'
......@@ -272,7 +270,7 @@
wday = 1 if wday > 7
%>
<% end %>
<% end %>
<% end %>
<% ###### Days headers ####### %>
<% if show_days %>
......@@ -369,10 +367,14 @@
<%= javascript_tag do %>
var issue_relation_type = <%= raw Redmine::Helpers::Gantt::DRAW_TYPES.to_json %>;
$(document).ready(drawGanttHandler);
$(window).resize(drawGanttHandler);
$(function() {
drawGanttHandler();
resizableSubjectColumn();
$("#draw_relations").change(drawGanttHandler);
$("#draw_progress_line").change(drawGanttHandler);
});
$(window).resize(function() {
drawGanttHandler();
resizableSubjectColumn();
});
<% end %>
......@@ -173,3 +173,25 @@ function drawGanttHandler() {
if ($("#draw_relations").prop('checked'))
drawRelations();
}
function resizableSubjectColumn(){
$('.issue-subject, .project-name, .version-name').each(function(){
$(this).width($(".gantt_subjects_column").width()-$(this).position().left);
});
$('td.gantt_subjects_column').resizable({
alsoResize: '.gantt_subjects_container, .gantt_subjects_container>.gantt_hdr, .project-name, .issue-subject, .version-name',
minWidth: 100,
handles: 'e',
containment: '#content',
create: function( event, ui ) {
$('.ui-resizable-e').css('cursor','ew-resize');
}
}).on('resize', function (e) {
e.stopPropagation();
});
if(isMobile()) {
$('td.gantt_subjects_column').resizable('disable');
}else{
$('td.gantt_subjects_column').resizable('enable');
};
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment