From 8535dba6799b0f9cf0814a8305730e58b94249ca Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Sun, 14 Aug 2016 23:42:33 +0200 Subject: [PATCH] small editbox improvement --- Postal.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Postal.lua b/Postal.lua index 0db24f0..ef174b1 100644 --- a/Postal.lua +++ b/Postal.lua @@ -161,14 +161,15 @@ function self:ADDON_LOADED() end) do local lastClick - editBox:SetScript('OnMouseUp', function() + editBox:SetScript('OnMouseDown', function() local x, y = GetCursorPosition() if lastClick and GetTime() - lastClick.t < .5 and x == lastClick.x and y == lastClick.y then - lastClick = nil - this:HighlightText() - else - lastClick = {t=GetTime(), x=x, y=y} + this:SetScript('OnUpdate', function() + this:HighlightText() + this:SetScript('OnUpdate', nil) + end) end + lastClick = {t=GetTime(), x=x, y=y} end) end end