Skip to content

Commit 9ed4859

Browse files
committed
fix chat menu showing the menu button
1 parent 15c7564 commit 9ed4859

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

ElvUI/Core/Modules/Chat/Chat.lua

+21-17
Original file line numberDiff line numberDiff line change
@@ -569,26 +569,29 @@ function CH:GetSmileyReplacementText(msg)
569569
return outstr
570570
end
571571

572-
function CH:CopyButtonOnMouseUp(btn)
573-
local chat = self:GetParent()
574-
if btn == 'RightButton' and chat:GetID() == 1 then
575-
local menu = _G.ChatMenu
576-
if menu then
577-
menu:ClearAllPoints()
572+
function CH:OpenChatMenu(chatMenu, buttonMenu)
573+
if chatMenu then
574+
chatMenu:ClearAllPoints()
578575

579-
local point = E:GetScreenQuadrant(self)
580-
if strfind(point, 'LEFT') then
581-
menu:SetPoint('BOTTOMLEFT', self, 'TOPRIGHT')
582-
else
583-
menu:SetPoint('BOTTOMRIGHT', self, 'TOPLEFT')
584-
end
585-
586-
ToggleFrame(menu)
576+
local point = E:GetScreenQuadrant(self)
577+
if strfind(point, 'LEFT') then
578+
chatMenu:SetPoint('BOTTOMLEFT', self, 'TOPRIGHT')
587579
else
588-
_G.ChatFrameMenuButton:ClearAllPoints()
589-
_G.ChatFrameMenuButton:SetPoint('TOPLEFT', _G.ChatFrame1.copyButton, 'TOPRIGHT')
590-
_G.ChatFrameMenuButton:OpenMenu()
580+
chatMenu:SetPoint('BOTTOMRIGHT', self, 'TOPLEFT')
591581
end
582+
583+
ToggleFrame(chatMenu)
584+
elseif buttonMenu then
585+
buttonMenu:ClearAllPoints()
586+
buttonMenu:SetPoint('TOPLEFT', _G.ChatFrame1.copyButton, 'TOPRIGHT')
587+
buttonMenu:OpenMenu()
588+
end
589+
end
590+
591+
function CH:CopyButtonOnMouseUp(btn)
592+
local chat = self:GetParent()
593+
if btn == 'RightButton' and chat:GetID() == 1 then
594+
CH:OpenChatMenu(_G.ChatMenu, _G.ChatFrameMenuButton)
592595
else
593596
CH:CopyChat(chat)
594597
end
@@ -790,6 +793,7 @@ function CH:PositionButtonFrame(chat)
790793

791794
chat.buttonFrame:ClearAllPoints()
792795
chat.buttonFrame:SetPoint('TOP', chat, 'BOTTOM', 0, -90000)
796+
chat.buttonFrame:SetClipsChildren(true)
793797
end
794798

795799
function CH:StyleChat(frame)

0 commit comments

Comments
 (0)