diff --git a/module/common/view/kanban.html.php b/module/common/view/kanban.html.php index ffd356593c..8bc37cdcb9 100644 --- a/module/common/view/kanban.html.php +++ b/module/common/view/kanban.html.php @@ -148,7 +148,7 @@ function renderProjectItem(item, $item) if(item.status === 'doing') { - var progress = item.hours ? Math.round(item.hours.progress || 0) : 0; + var progress = item.hours && !Array.isArray(item.hours) ? Math.round(item.hours.progress || 0) : 0; var $progress = $item.find('.progress-pie'); if(!$progress.length) { @@ -191,7 +191,7 @@ function renderExecutionItem(item, $item) } $title.text(item.name).attr('title', item.name); - var progress = item.progress || (item.hours ? item.hours.progress : undefined); + var progress = item.progress || (item.hours && !Array.isArray(item.hours) ? Math.round(item.hours.progress) : undefined); if(progress === undefined && window.hourList) { var hoursInfo = window.hourList[item._id]; @@ -320,14 +320,18 @@ function updateKanbanAffixState() { var $board = $(this); var offsetTop = $board.offset().top; - if(scrollTop >= offsetTop && offsetTop > currentOffsetTop) + if(scrollTop >= offsetTop && offsetTop > currentOffsetTop && scrollTop < (offsetTop + $board.outerHeight())) { currentOffsetTop = offsetTop; $currentAffixedBoard = $board; } }); - if($lastAffixedBoard.length) affixKanbanHeader($lastAffixedBoard, false); + if($lastAffixedBoard.length && (!$currentAffixedBoard || $lastAffixedBoard[0] !== $currentAffixedBoard[0])) + { + affixKanbanHeader($lastAffixedBoard, false); + } + if($currentAffixedBoard) affixKanbanHeader($currentAffixedBoard, true); } diff --git a/module/product/js/kanban.js b/module/product/js/kanban.js index 5a2a2b5b40..db2ac2681c 100644 --- a/module/product/js/kanban.js +++ b/module/product/js/kanban.js @@ -55,7 +55,7 @@ function processKanbanData(key, programsData) $.each(productProjects, function(projectID) { var project = projectList[projectID]; - if(!project) return; + if(!project || !project.id) return; var projectItem = $.extend({}, project, {id: 'project-' + projectID, _id: projectID}); items.doingProject.push(projectItem); }); @@ -70,7 +70,7 @@ function processKanbanData(key, programsData) $.each(productProjects, function(projectID) { var execution = latestExecutions[projectID]; - if(!execution) return; + if(!execution || !execution.id) return; var executionItem = $.extend({}, execution, {id: 'execution-' + execution.id, _id: execution.id}); items.doingExecution.push(executionItem); }); @@ -83,7 +83,7 @@ function processKanbanData(key, programsData) { $.each(releases, function(releaseID, release) { - if(!release) return; + if(!release || !release.id) return; var releaseItem = $.extend({}, release, {id: 'release-' + releaseID, _id: releaseID}); items.normalRelease.push(releaseItem); }); diff --git a/module/program/js/kanban.js b/module/program/js/kanban.js index 7429511136..a58641f5f5 100644 --- a/module/program/js/kanban.js +++ b/module/program/js/kanban.js @@ -68,7 +68,7 @@ function processKanbanData(key, programsData) items.doingProject.push(projectItem); var execution = project.execution; - if(!execution) return; + if(!execution || !execution.id) return; var executionItem = $.extend({}, execution, {id: 'execution-' + execution.id, _id: execution.id}); items.doingExecution.push(executionItem); }); @@ -81,7 +81,7 @@ function processKanbanData(key, programsData) { $.each(releases, function(releaseID, release) { - if(!release) return; + if(!release || !release.id) return; var releaseItem = $.extend({}, release, {id: 'release-' + releaseID, _id: releaseID}); items.normalRelease.push(releaseItem); }); diff --git a/module/project/js/kanban.js b/module/project/js/kanban.js index 091dd94671..4324d712c9 100644 --- a/module/project/js/kanban.js +++ b/module/project/js/kanban.js @@ -39,7 +39,7 @@ function processKanbanData(key, programGroup) if(status === 'doing') { var execution = latestExecutions[projectID]; - if(execution) + if(execution && execution.id) { var executionItem = $.extend({}, execution, {id: 'execution-' + execution.id, _id: execution.id}); items.doingExecution = [executionItem];