forked from extern/egroupware
Style gantt links as invalid based on if the start/end dates are correct for the link type
This commit is contained in:
parent
d1d11c63df
commit
f8cb222580
@ -753,4 +753,33 @@ $j(function() {
|
||||
return "weekend"
|
||||
}
|
||||
};
|
||||
|
||||
// Link styling
|
||||
gantt.templates.link_class = function(link) {
|
||||
var link_class = '';
|
||||
var source = gantt.getTask(link.source);
|
||||
var target = gantt.getTask(link.target);
|
||||
var valid = true;
|
||||
|
||||
var types = gantt.config.links;
|
||||
switch (link.type)
|
||||
{
|
||||
case types.finish_to_start:
|
||||
valid = (source.end_date <= target.start_date)
|
||||
break;
|
||||
case types.start_to_start:
|
||||
valid = (source.start_date <= target.start_date);
|
||||
break;
|
||||
case types.finish_to_finish:
|
||||
valid = (source.end_date >= target.end_date);
|
||||
break;
|
||||
case types.start_to_finish:
|
||||
valid = (source.start_date >= target.end_date)
|
||||
break;
|
||||
}
|
||||
|
||||
link_class += valid ? '' : 'invalid_constraint';
|
||||
|
||||
return link_class;
|
||||
}
|
||||
});
|
@ -1448,6 +1448,18 @@ div.ui-toolbar-menulist{
|
||||
{
|
||||
background-color: #f7eb91;
|
||||
}
|
||||
.et2_gantt .gantt_task_link.invalid_constraint .gantt_line_wrapper div
|
||||
{
|
||||
background-color: red;
|
||||
}
|
||||
.et2_gantt .gantt_task_link.invalid_constraint .gantt_link_arrow_left
|
||||
{
|
||||
border-right-color: red;
|
||||
}
|
||||
.et2_gantt .gantt_task_link.invalid_constraint .gantt_link_arrow_right
|
||||
{
|
||||
border-left-color: red;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do not wrap content of a single widget incl. a label or children of a hbox.
|
||||
|
Loading…
Reference in New Issue
Block a user