|
|
|
@ -315,6 +315,7 @@ angular.module('openproject.timelines.models') |
|
|
|
|
// for planning element parents. if there is no planning element
|
|
|
|
|
// type and there are no children, use a default color.
|
|
|
|
|
var pet = this.getPlanningElementType(); |
|
|
|
|
var paper = this.timeline.getPaper(); |
|
|
|
|
var color; |
|
|
|
|
|
|
|
|
|
if (pet && pet.color) { |
|
|
|
@ -327,9 +328,31 @@ angular.module('openproject.timelines.models') |
|
|
|
|
|
|
|
|
|
if (!this.hasBothDates()) { |
|
|
|
|
if (this.hasStartDate()) { |
|
|
|
|
color = "180-#ffffff-" + color; |
|
|
|
|
var noEndDateGradient = jQuery('#noEndDateGradient_' + pet.id); |
|
|
|
|
if (noEndDateGradient.length == 0) { |
|
|
|
|
noEndDateGradient = paper.gradient( |
|
|
|
|
'noEndDateGradient_' + pet.id, |
|
|
|
|
[ |
|
|
|
|
{offset: '5%', 'stop-color': color, 'stop-opacity': '1'}, |
|
|
|
|
{offset: '95%', 'stop-color': '#ffffff', 'stop-opacity': '0'} |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
color = 'url(#noEndDateGradient_' + pet.id + ')'; |
|
|
|
|
} else { |
|
|
|
|
color = "180-" + color + "-#ffffff"; |
|
|
|
|
var noStartDateGradient = jQuery('#noStartDateGradient_' + pet.id); |
|
|
|
|
if (noStartDateGradient.length == 0) { |
|
|
|
|
noStartDateGradient = paper.gradient( |
|
|
|
|
'noStartDateGradient_' + pet.id, |
|
|
|
|
[ |
|
|
|
|
{offset: '5%', 'stop-color': '#ffffff', 'stop-opacity': '0'}, |
|
|
|
|
{offset:'95%', 'stop-color': color, 'stop-opacity': '1'} |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
color = 'url(#noStartDateGradient_' + pet.id + ')'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|