From bec14c9a4a5b36299159217dbf82f6eba1e2e26a Mon Sep 17 00:00:00 2001 From: liuhong Date: Wed, 14 Dec 2022 07:06:19 +0000 Subject: [PATCH] * Adjust code 79667. --- module/story/js/common.js | 15 ++++++++++++--- module/story/view/affected.html.php | 16 +++++----------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/module/story/js/common.js b/module/story/js/common.js index 2e2e059c90..cb6b25145b 100644 --- a/module/story/js/common.js +++ b/module/story/js/common.js @@ -96,7 +96,7 @@ function loadURS(allURS) } $('.twins').mouseover(function() { - $(this).find('a.unlink').addClass('hide'); + $(this).parent('ul').find('a.unlink').addClass('hide'); $(this).find('.unlink').removeClass('hide'); }); $('.twins').mouseenter(function() { @@ -126,8 +126,17 @@ function relieve(index) if(data.result == 'success') { - if(data.silbingsCount != 1) $('[data-id="' + index + '"]').closest('tr').remove(); - parent.location.reload(); + if(data.silbingsCount != 0) $('[data-id="' + index + '"]').parent('li').remove(); + if(data.silbingsCount == 0 || index == storyID) + { + $('[href="#legendTwins"]').parent('li').next('li').addClass('active');; + $('[href="#legendTwins"]').parent('li').remove(); + $('#legendTwins').next('div').addClass('active'); + $('#legendTwins').remove(); + $('#twinsTitle').remove(); + $('#twinsList').remove(); + } + } }, 'json'); } diff --git a/module/story/view/affected.html.php b/module/story/view/affected.html.php index a8f580e29b..64509dbbee 100644 --- a/module/story/view/affected.html.php +++ b/module/story/view/affected.html.php @@ -1,17 +1,11 @@ twins) ? count(explode( ',', trim($story->twins, ','))) + 1 : 0; - $lang->story->currentBranch = sprintf($this->lang->story->currentBranch, $this->lang->product->branchName[$product->type]); - js::set('relieveURL', inlink('ajaxRelieveTwins')); - js::set('storyID', $story->id); - js::set('relieved', $lang->story->relieved); - js::set('relievedTip', $lang->story->relievedTip); - js::set('cancel', $lang->cancel); + $twinsCount = !empty($story->twins) ? count(explode( ',', trim($story->twins, ','))) + 1 : 0; + $twinsClass = isonlybody() ? 'showinonlybody' : 'iframe'; $canViewLinkStory = common::hasPriv('story', 'view'); - $canRelieved = common::hasPriv('story', 'relieved'); + $lang->story->currentBranch = sprintf($this->lang->story->currentBranch, $this->lang->product->branchName[$product->type]); array_unshift($twins, $story); - $twinsClass = isonlybody() ? 'showinonlybody' : 'iframe'; }?>