From c5770685cde11444aad3d35d74ea0226adc5804a Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Sat, 10 Apr 2010 05:16:28 -0400 Subject: [PATCH] In ListItem_OnClick(): When clicking an expanded entry, back up in the list until that entry's parent is found instead simply looking for any header/subheader. --- Frame.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Frame.lua b/Frame.lua index f794863..f4d4cc0 100644 --- a/Frame.lua +++ b/Frame.lua @@ -2750,20 +2750,23 @@ do traverseIndex = clickedIndex - 1 - while entries[traverseIndex] and entries[traverseIndex].type ~= "header" and entries[traverseIndex].type ~= "subheader" do + while entries[traverseIndex] and entries[traverseIndex] ~= clicked_line.parent do traverseIndex = traverseIndex - 1 end entries[traverseIndex].is_expanded = false - traverseIndex = traverseIndex + 1 - local children = clicked_line.parent.children + local children = entries[traverseIndex].children -- Remove the expanded lines. if children then + traverseIndex = traverseIndex + 1 + while #children > 0 do table.remove(children) ReleaseTable(table.remove(ListFrame.entries, traverseIndex)) end + else + addon:Debug("Error: clicked_line's parent has no children.") end end highlight:Hide() -- 1.7.9.5