Make popout frame handle hiding the splitstackframe

This commit is contained in:
tekkub ʕ ´ᴥ` ʔ 2016-09-11 18:28:40 -06:00
parent 06e0a51325
commit b8a0891478
2 changed files with 7 additions and 4 deletions

View File

@ -70,10 +70,7 @@ function ns.NewMainFrame()
GVS:RegisterEvent("MERCHANT_UPDATE")
GVS:RegisterEvent("CURRENCY_DISPLAY_UPDATE")
end)
GVS:SetScript("OnHide", function()
GVS:UnregisterAllEvents()
if StackSplitFrame:IsVisible() then StackSplitFrame:Hide() end
end)
GVS:SetScript("OnHide", GVS.UnregisterAllEvents)
return GVS
end

View File

@ -16,6 +16,11 @@ local function OnClick(self, button)
end
local function OnHide()
if StackSplitFrame:IsVisible() then StackSplitFrame:Hide() end
end
local function PopoutSplitStack(self, qty)
ns.Purchase(self:GetParent():GetID(), qty)
end
@ -30,6 +35,7 @@ function ns.NewQtyPopoutFrame(parent)
frame:GetHighlightTexture():SetTexCoord(0.15625, 1, 0.84375, 1, 0.15625, 0.5, 0.84375, 0.5)
frame:SetScript("OnClick", OnClick)
frame:SetScript("OnHide", OnHide)
frame.SplitStack = PopoutSplitStack