# HG changeset patch # User Flick # Date 1301354601 25200 # Node ID d7a7ef367fafe77dc3c281d32f8d8ba965fe7aeb # Parent 46b59a9ded7644b6b5f6f0dd4d520760c4d65092 Fix Lua error when opening global config from editor diff -r 46b59a9ded76 -r d7a7ef367faf Editor.lua --- a/Editor.lua Mon Mar 28 14:52:35 2011 -0700 +++ b/Editor.lua Mon Mar 28 16:23:21 2011 -0700 @@ -43,11 +43,6 @@ frame:SetClampedToScreen(true) frame:Hide() - frame:SetScript("OnHide", - function(...) - ReAction:SetConfigMode(false) - end) - self.title = ("%s - %s"):format(L["ReAction"],L["Bar Editor"]) self.gui:SetTitle(self.title) @@ -61,7 +56,19 @@ type = "execute", name = L["Global Config"], desc = L["Opens ReAction global configuration settings panel"], - func = function() ReAction:ShowOptions(); self:Close() end, + func = function() + -- AceConfigDialog calls :Open() after every selection, making it + -- generally not possible to cleanly close from a menu item. + -- If you don't use a custom frame, you can use ACD:Close(), but since + -- we're using a custom frame, we have to do the work of closing later in an + -- OnUpdate script. + ReAction:ShowOptions(); + frame:SetScript("OnUpdate", + function() + self:Close() + frame:SetScript("OnUpdate",nil) + end) + end, order = 1 }, desc = {