From eddd9caf619fb1d1d263d7ec6ffc6243278fad7c Mon Sep 17 00:00:00 2001 From: Catouse Date: Mon, 9 Jul 2018 17:30:02 +0800 Subject: [PATCH] * finish task #4501 and fix bug #1980. --- module/product/js/browse.js | 22 +++++++++++++++++++--- module/story/model.php | 21 ++++++++++++++------- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/module/product/js/browse.js b/module/product/js/browse.js index 7b2f1ad1fe..2d5737f69f 100644 --- a/module/product/js/browse.js +++ b/module/product/js/browse.js @@ -1,7 +1,23 @@ $(function() { - $('.popoverStage').mouseover(function(){$(this).popover('show')}); - $('.popoverStage').mouseout(function(){$(this).popover('hide')}); - if($('#storyList thead th.c-title').width() < 150) $('#storyList thead th.c-title').width(150); + + // Fix state dropdown menu position + $('.c-stage > .dropdown').each(function() + { + var $this = $(this); + var menuHeight = $(this).find('.dropdown-menu').outerHeight(); + var $tr = $this.closest('tr'); + var height = 0; + while(height < menuHeight) + { + var $next = $tr.next('tr'); + if(!$next.length) break; + height += $next.outerHeight; + } + if(height < menuHeight) + { + $this.addClass('dropup'); + } + }); }); diff --git a/module/story/model.php b/module/story/model.php index ede40bea53..bdddb3f696 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2362,15 +2362,22 @@ class storyModel extends model echo $story->estimate; break; case 'stage': - echo "id]) ? " class='popoverStage' data-toggle='popover' data-placement='bottom' data-target='\$next'" : '') . ">"; - echo $this->lang->story->stageList[$story->stage]; - if(isset($storyStages[$story->id])) echo ""; - echo ''; if(isset($storyStages[$story->id])) { - echo "
"; - foreach($storyStages[$story->id] as $storyBranch => $storyStage) echo $branches[$storyBranch] . ": " . $this->lang->story->stageList[$storyStage->stage] . '
'; - echo "
"; + echo "'; + } + else + { + echo $this->lang->story->stageList[$story->stage]; } break; case 'taskCount':