Timeline: Ensure minimum width for bars

pull/5181/head
Roman Roelofsen 8 years ago
parent 2786bf96df
commit fdf01d3359
  1. 10
      frontend/app/components/wp-table/timeline/cell-renderer/timeline-cell-renderer.ts

@ -141,6 +141,10 @@ export class TimelineCellRenderer {
* false, if the element must be removed from the timeline.
*/
public update(element: HTMLDivElement, wp: WorkPackageResourceInterface, renderInfo: RenderInfo): boolean {
console.log(wp);
// general settings - bar
element.style.marginLeft = renderInfo.viewParams.scrollOffsetInPx + "px";
element.style.backgroundColor = this.typeColor(renderInfo.workPackage);
@ -172,7 +176,11 @@ export class TimelineCellRenderer {
// duration
const duration = due.diff(start, "days") + 1;
element.style.width = calculatePositionValueForDayCount(viewParams, duration);
element.style.minWidth = "10px";
// ensure minimum width
if (!_.isNaN(start.valueOf()) || !_.isNaN(due.valueOf())) {
element.style.minWidth = "10px";
}
return true;
}

Loading…
Cancel
Save