small editbox improvement
This commit is contained in:
+6
-5
@@ -161,14 +161,15 @@ function self:ADDON_LOADED()
|
|||||||
end)
|
end)
|
||||||
do
|
do
|
||||||
local lastClick
|
local lastClick
|
||||||
editBox:SetScript('OnMouseUp', function()
|
editBox:SetScript('OnMouseDown', function()
|
||||||
local x, y = GetCursorPosition()
|
local x, y = GetCursorPosition()
|
||||||
if lastClick and GetTime() - lastClick.t < .5 and x == lastClick.x and y == lastClick.y then
|
if lastClick and GetTime() - lastClick.t < .5 and x == lastClick.x and y == lastClick.y then
|
||||||
lastClick = nil
|
this:SetScript('OnUpdate', function()
|
||||||
this:HighlightText()
|
this:HighlightText()
|
||||||
else
|
this:SetScript('OnUpdate', nil)
|
||||||
lastClick = {t=GetTime(), x=x, y=y}
|
end)
|
||||||
end
|
end
|
||||||
|
lastClick = {t=GetTime(), x=x, y=y}
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user