mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
Make gantt columns resizable (#20481).
Contributed by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@17026 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
980ea2160d
commit
412aa218e8
@ -137,7 +137,6 @@
|
|||||||
<%= content_tag(:div, :style => style, :class => "gantt_subjects_container") do %>
|
<%= content_tag(:div, :style => style, :class => "gantt_subjects_container") do %>
|
||||||
<%
|
<%
|
||||||
style = ""
|
style = ""
|
||||||
style += "right:-2px;"
|
|
||||||
style += "width: #{subject_width}px;"
|
style += "width: #{subject_width}px;"
|
||||||
style += "height: #{headers_height}px;"
|
style += "height: #{headers_height}px;"
|
||||||
style += 'background: #eee;'
|
style += 'background: #eee;'
|
||||||
@ -145,7 +144,6 @@
|
|||||||
<%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %>
|
<%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %>
|
||||||
<%
|
<%
|
||||||
style = ""
|
style = ""
|
||||||
style += "right:-2px;"
|
|
||||||
style += "width: #{subject_width}px;"
|
style += "width: #{subject_width}px;"
|
||||||
style += "height: #{t_height}px;"
|
style += "height: #{t_height}px;"
|
||||||
style += 'border-left: 1px solid #c0c0c0;'
|
style += 'border-left: 1px solid #c0c0c0;'
|
||||||
@ -369,10 +367,14 @@
|
|||||||
|
|
||||||
<%= javascript_tag do %>
|
<%= javascript_tag do %>
|
||||||
var issue_relation_type = <%= raw Redmine::Helpers::Gantt::DRAW_TYPES.to_json %>;
|
var issue_relation_type = <%= raw Redmine::Helpers::Gantt::DRAW_TYPES.to_json %>;
|
||||||
$(document).ready(drawGanttHandler);
|
|
||||||
$(window).resize(drawGanttHandler);
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
drawGanttHandler();
|
||||||
|
resizableSubjectColumn();
|
||||||
$("#draw_relations").change(drawGanttHandler);
|
$("#draw_relations").change(drawGanttHandler);
|
||||||
$("#draw_progress_line").change(drawGanttHandler);
|
$("#draw_progress_line").change(drawGanttHandler);
|
||||||
});
|
});
|
||||||
|
$(window).resize(function() {
|
||||||
|
drawGanttHandler();
|
||||||
|
resizableSubjectColumn();
|
||||||
|
});
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@ -173,3 +173,25 @@ function drawGanttHandler() {
|
|||||||
if ($("#draw_relations").prop('checked'))
|
if ($("#draw_relations").prop('checked'))
|
||||||
drawRelations();
|
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');
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user