Project

General

Profile

Feature #20481 » change_to_right_and_left_resizable_panel_v2.patch

Mizuki ISHIKAWA, 2017-07-25 10:25

View differences:

app/views/gantts/show.html.erb
<%= 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;'
......
<%= 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;'
......
wday = 1 if wday > 7
%>
<% end %>
<% end %>
<% end %>
<% ###### Days headers ####### %>
<% if show_days %>
......
<%= 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 %>
public/javascripts/gantt.js
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');
};
}
(3-3/6)