Quantcast

In ListItem_OnClick(): When clicking on an expanded entry/subentry, check for headers AND subheaders - checking for one or the other will delete things it shouldn't.

James D. Callahan III [03-25-10 - 09:10]
In ListItem_OnClick(): When clicking on an expanded entry/subentry, check for headers AND subheaders - checking for one or the other will delete things it shouldn't.
Filename
Frame.lua
diff --git a/Frame.lua b/Frame.lua
index 1a71a49..5fde3e0 100644
--- a/Frame.lua
+++ b/Frame.lua
@@ -2503,18 +2503,17 @@ do
 		else
 			-- This is an expanded entry. Back up in the list of buttons until we find its header line.
 			local entries = MainPanel.scroll_frame.entries
-			local check_type = clicked_line.type == "entry" and "header" or "subheader"

 			traverseIndex = clickedIndex - 1

-			while entries[traverseIndex] and entries[traverseIndex].type ~= check_type do
+			while entries[traverseIndex] and entries[traverseIndex].type ~= "header" and entries[traverseIndex].type ~= "subheader" do
 				traverseIndex = traverseIndex - 1
 			end
 			entries[traverseIndex].is_expanded = false
 			traverseIndex = traverseIndex + 1

 			-- Remove the expanded lines until we get to a header/subheader.
-			while entries[traverseIndex] and entries[traverseIndex].type ~= check_type do
+			while entries[traverseIndex] and entries[traverseIndex].type ~= "header" and entries[traverseIndex].type ~= "subheader" do
 				ReleaseTable(table.remove(entries, traverseIndex))

 				if not entries[traverseIndex] then