Defect #32812

Clicking on a parent object in gantt wrongly collapses objects at the same level

Added by Yuichi HARADA 6 months ago. Updated 6 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Gantt
Target version:4.1.1
Resolution:Fixed Affected version:

Description

We expect that when a parent ticket is collapsed, only tickets of the child hierarchy and below will be collapsed.
Actually, when the parent ticket (#9) is collapsed, "tickets of the child hierarchy and below (#68,#69,#70)" and " ticket in the same hierarchy (#10)" are collapsed.

Reproduce:

Expect: Actual:

reproduce.png (145 KB) Yuichi HARADA, 2020-01-15 03:55

expect.png (124 KB) Yuichi HARADA, 2020-01-15 03:56

actual.png (116 KB) Yuichi HARADA, 2020-01-15 03:57


Related issues

Related to Redmine - Feature #6417: Allow collapse/expand in gantt chart Closed 2010-09-16

Associated revisions

Revision 19433
Added by Go MAEDA 6 months ago

Clicking on a parent object in gantt wrongly collapses objects at the same level (#32812).

Patch by Yuichi HARADA.

Revision 19434
Added by Go MAEDA 6 months ago

Merged r19433 from trunk to 4.1-stable (#32812).

History

#1 Updated by Yuichi HARADA 6 months ago

The cause is that the start position (subject_left) did not include the width of the folding icon.
Solved by the following patch (Firefox, Chrome, Safari, IE11, Edge confirmed).

diff --git a/public/javascripts/gantt.js b/public/javascripts/gantt.js
index ebaaa2b46..efda080ee 100644
--- a/public/javascripts/gantt.js
+++ b/public/javascripts/gantt.js
@@ -231,8 +231,9 @@ function resizableSubjectColumn(){
 }

 ganttEntryClick = function(e){
-  var subject = $(e.target.parentElement);
-  var subject_left = parseInt(subject.css('left'));
+  var icon_expander = e.target;
+  var subject = $(icon_expander.parentElement);
+  var subject_left = parseInt(subject.css('left')) + parseInt(icon_expander.offsetWidth);
   var target_shown = null;
   var target_top = 0;
   var total_height = 0;

#2 Updated by Go MAEDA 6 months ago

  • Status changed from New to Confirmed
  • Target version set to 4.1.1

Setting the target version to 4.1.1.

#3 Updated by Go MAEDA 6 months ago

  • Related to Feature #6417: Allow collapse/expand in gantt chart added

#4 Updated by Go MAEDA 6 months ago

  • Subject changed from Gantt: Folding parent ticket collapses all subsequent tickets to Clicking on a parent object in gantt wrongly collapses objects at the same level
  • Status changed from Confirmed to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix. Thank you.

Also available in: Atom PDF