diff --git a/frames/MainFrame.lua b/frames/MainFrame.lua index 48c026e..7ee7c7c 100644 --- a/frames/MainFrame.lua +++ b/frames/MainFrame.lua @@ -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 diff --git a/frames/QtyPopout.lua b/frames/QtyPopout.lua index 382c769..1ce06d0 100644 --- a/frames/QtyPopout.lua +++ b/frames/QtyPopout.lua @@ -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