From 38e8f5224d81724246aec276d603787a625c7c64 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Fri, 18 Jun 2010 05:16:43 -0400 Subject: [PATCH] Only update the list when selecting a tab after the first time the list is shown, to avoid updating twice. --- Frame.lua | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Frame.lua b/Frame.lua index a4b8ab4..2439a4c 100644 --- a/Frame.lua +++ b/Frame.lua @@ -1120,8 +1120,14 @@ do tab:ToBack() end end + + -- If the MainPanel doesn't already have a current_tab, do not call ListFrame:Update() - + -- at this point, it's the first time the panel has been shown so the update will fire twice. + if MainPanel.current_tab then + ListFrame:Update(nil, false) + end + MainPanel.current_tab = id_num addon.db.profile.current_tab = id_num - ListFrame:Update(nil, false) PlaySound("igCharacterInfoTab") end @@ -1307,11 +1313,14 @@ end -- do-block ------------------------------------------------------------------------------- MainPanel:SetScript("OnShow", function(self) - local current_tab = self.tabs[addon.db.profile.current_tab] - local on_click = current_tab:GetScript("OnClick") - - on_click(current_tab) + -- If there is no current tab, this is the first time the panel has been + -- shown so things must be initialized. + if not self.current_tab then + local current_tab = self.tabs[addon.db.profile.current_tab] + local on_click = current_tab:GetScript("OnClick") + on_click(current_tab) + end self.sort_button:SetTextures() end) -- 1.7.9.5