Skip to content

Commit

Permalink
Merge branch 'bugfixFor1.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
GEROMAX committed Jun 15, 2017
2 parents 4f0ba16 + 38a301c commit 9700cdf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This plugin provide accordion to subtask list of issue.

* http://www.redmine.org/plugins/redmine_subtask_list_accordion

## Features

* Add accordion feature to subtask-list.
Expand All @@ -14,6 +16,7 @@ Redmine 3.3 stable

Tested on:
* 3.3.2
* 3.3.3

## Installation

Expand Down
23 changes: 14 additions & 9 deletions assets/javascripts/subtask_list_accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@ function getParentIssue(startPos, rank, sameTreeOnly)
var issuesSelector = "table.list > tbody > tr";
var rankAttr = rank <= 0 ? ":not(.idnt)" : "tr.idnt-" + rank;
var nextAttr = "tr.idnt-" + (rank + 1 - 0);
var selectorP = ":gt(" + startPos.val + ")" + rankAttr;
var selectorP = (startPos.val + rank) > 0 ? ":gt(" + startPos.val + ")" + rankAttr : rankAttr;
var selectorC = nextAttr + ":first";
var pp = $(issuesSelector + selectorP + " + " + selectorC);

if (pp.size() != 1)
{
//no parent
return $();
}

//get parent
startPos.val = pp.index() - 1;
return slaTRs.filter(function(index){
return index == pp.index() - 1;
return index == startPos.val;
});
}

Expand Down Expand Up @@ -65,7 +67,7 @@ function getChildIssues(startPos, rank)
break;
}
}
while (cc < slaTRsSize)
while (cc < slaTRsSize);

startPos.val = endIdx;
return slaTRs.filter(function(index){ return index >= startIdx && index <= endIdx; });
Expand Down Expand Up @@ -208,13 +210,16 @@ function allExpandNext()
//make rank
for (var rank = 0; rank <= (parentTR.attr("rank") - 0 + 1); rank++)
{
var parentFound = false;
var parentPos = { val: 0 };
do
if (rank > 0)
{
parentFound = setAccordion(parentPos, rank, true, false);
var parentFound = false;
var parentPos = { val: 0 };
do
{
parentFound = setAccordion(parentPos, rank, true, false);
}
while(parentFound);
}
while(parentFound);

//show
if (rank <= (parentTR.attr("rank") - 0))
Expand Down
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
name 'Redmine Subtask List Accordion plugin'
author 'Ryuta Tobita'
description 'This plugin provide accordion to subtask list of issue.'
version '1.3.0'
version '1.3.1'
url 'https://github.com/GEROMAX/redmine_subtask_list_accordion'
author_url 'https://github.com/GEROMAX'
end

0 comments on commit 9700cdf

Please sign in to comment.