From fdf01d33590984a8512fc71832f82ea26ebb264e Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Mon, 23 Jan 2017 15:26:22 +0100 Subject: [PATCH] Timeline: Ensure minimum width for bars --- .../timeline/cell-renderer/timeline-cell-renderer.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/app/components/wp-table/timeline/cell-renderer/timeline-cell-renderer.ts b/frontend/app/components/wp-table/timeline/cell-renderer/timeline-cell-renderer.ts index a32665e258..d21929f789 100644 --- a/frontend/app/components/wp-table/timeline/cell-renderer/timeline-cell-renderer.ts +++ b/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; }