Quantcast

Some changes to dropdown. In theory this should make things better

Darthpred [10-05-16 - 06:44]
Some changes to dropdown. In theory this should make things better
Filename
ElvUI_SLE/core/dropdown.lua
diff --git a/ElvUI_SLE/core/dropdown.lua b/ElvUI_SLE/core/dropdown.lua
index c6c54ad..dbd75dd 100644
--- a/ElvUI_SLE/core/dropdown.lua
+++ b/ElvUI_SLE/core/dropdown.lua
@@ -69,26 +69,29 @@ end

 function SLE:DropDown(list, frame, MenuAnchor, FramePoint, xOffset, yOffset, parent, customWidth, justify)
 	if T.InCombatLockdown() then return end
+	if not frame.buttons then
+		frame.buttons = {}
+		frame:SetFrameStrata("DIALOG")
+		frame:SetClampedToScreen(true)
+		T.tinsert(UISpecialFrames, frame:GetName())
+		frame:Hide()
+	end
+	for i=1, #frame.buttons do
+		local btn = frame.buttons[i]
+		btn.UseTooltip = false
+		btn.func = nil
+		btn.secure = nil
+		list[i].TooltipText = nil
+		btn.text:SetText("")
+		btn:Hide()
+	end
 	if not frame:IsShown() then
-		if not frame.buttons then
-			frame.buttons = {}
-			frame:SetFrameStrata("DIALOG")
-			frame:SetClampedToScreen(true)
-			T.tinsert(UISpecialFrames, frame:GetName())
-			frame:Hide()
-		end
-
 		xOffset = xOffset or 0
 		yOffset = yOffset or 0
 		local TitleCount = 0
 		local AddOffset = 0

-		for i=1, #frame.buttons do
-			frame.buttons[i].UseTooltip = false
-			frame.buttons[i]:Hide()
-		end
 		if not parent then FramePoint = "CURSOR" end
-
 		for i=1, #list do
 			frame.buttons[i] = frame.buttons[i] or CreateListButton(frame)
 			local btn = frame.buttons[i]