From eab8e216bd8eda9697eff89b1baafa26ec05abb5 Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Fri, 21 Jan 2011 17:57:45 +0100 Subject: [PATCH] Fix javascript error when resizing ganttpanel and chart is not shown FEA: ItEr68S04BugFixing --- ganttzk/src/main/resources/web/js/ganttz/tasklist.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ganttzk/src/main/resources/web/js/ganttz/tasklist.js b/ganttzk/src/main/resources/web/js/ganttz/tasklist.js index b276c27a0..2cd137eb0 100644 --- a/ganttzk/src/main/resources/web/js/ganttz/tasklist.js +++ b/ganttzk/src/main/resources/web/js/ganttz/tasklist.js @@ -725,8 +725,12 @@ zkTaskContainer.legendResize = function(cmp) { var taskdetailsContainer = YAHOO.util.Selector.query('.taskdetailsContainer')[0]; var legendContainer = YAHOO.util.Selector.query('.legend-container')[0]; var legendContainerEarned = YAHOO.util.Selector.query('.legend-container')[1]; - legendContainer.style["width"] = (taskdetailsContainer.clientWidth - LEGEND_CONTAINER_OFFSET )+"px"; - legendContainerEarned.style["width"] = (taskdetailsContainer.clientWidth - LEGEND_CONTAINER_OFFSET )+"px"; + if ( legendContainer != undefined ) { + legendContainer.style["width"] = (taskdetailsContainer.clientWidth - LEGEND_CONTAINER_OFFSET )+"px"; + } + if ( legendContainerEarned != undefined ) { + legendContainerEarned.style["width"] = (taskdetailsContainer.clientWidth - LEGEND_CONTAINER_OFFSET )+"px"; + } };