diff classes/ActionButton.lua @ 132:16048f516f5e

More Button refactoring
author Flick <flickerstreak@gmail.com>
date Sat, 07 Mar 2009 00:11:03 +0000
parents e39d80bb0b7a
children 1f36187a94cf
line wrap: on
line diff
--- a/classes/ActionButton.lua	Fri Mar 06 23:58:02 2009 +0000
+++ b/classes/ActionButton.lua	Sat Mar 07 00:11:03 2009 +0000
@@ -229,13 +229,12 @@
   local f = self:GetFrame()
   local c = self:GetConfig()
 
-  f:UnregisterAllEvents()
+  f:SetAttribute("_childupdate-vehicle",nil)
+  f:SetAttribute("action",c.actionID) -- so that Destroy releases the right one
 
-  f:SetAttribute("_childupdate-vehicle",nil)
-
-  self:ReleaseActionID(c.actionID)
-  if c.pageactions then
-    for _, id in ipairs(c.pageactions) do
+  if c.pageactions and #c.pageActions > 1 then
+    for i = 2, #c.pageActions do 
+      self:ReleaseActionID(c.pageactions[i])
       self:ReleaseActionID(id)
     end
   end