From 2879e7d43bc31200a26038ebe0f085bb96a99718 Mon Sep 17 00:00:00 2001 From: Xruptor Date: Tue, 4 Jan 2011 15:14:33 -0500 Subject: [PATCH] -Fixed an issue where the editbox would sometimes interfere with clicking the tabs. --- ChatInputTop.lua | 8 ++++++++ ChatInputTop.toc | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChatInputTop.lua b/ChatInputTop.lua index c86ff10..abd17f9 100644 --- a/ChatInputTop.lua +++ b/ChatInputTop.lua @@ -10,11 +10,19 @@ eventFrame:SetScript("OnEvent", function(self, event, ...) end for i = 1, NUM_CHAT_WINDOWS do + local n = ("ChatFrame%d"):format(i) local eb = _G[("ChatFrame%dEditBox"):format(i)] eb:ClearAllPoints() eb:SetPoint("BOTTOMLEFT", ("ChatFrame%d"):format(i), "TOPLEFT", -5, 0) eb:SetPoint("BOTTOMRIGHT", ("ChatFrame%d"):format(i), "TOPRIGHT", 5, 0) + + --when the editbox is on the top, complications occur because sometimes you are not allowed to click on the tabs. + --to fix this we'll just make the tab close the editbox + --also force the editbox to hide itself when it loses focus + _G[n.."Tab"]:HookScript("OnClick", function() eb:Hide() end) + eb:HookScript("OnEditFocusLost", function(self) self:Hide() end) + end eventFrame:UnregisterEvent("ADDON_LOADED") diff --git a/ChatInputTop.toc b/ChatInputTop.toc index 8e3f421..7f6e706 100644 --- a/ChatInputTop.toc +++ b/ChatInputTop.toc @@ -1,6 +1,6 @@ ## Interface: 40000 ## Title: ChatInputTop ## Author: Xruptor -## Version: 1.4 +## Version: 1.5 ## Notes: All this does is move the input box to the top when typing in the chat frame. ChatInputTop.lua -- 1.7.9.5