name input change

This commit is contained in:
Manuel Simon Hirsig
2017-11-09 00:56:32 +01:00
parent b182f23e55
commit 3df4912710
+12 -1
View File
@@ -56,7 +56,7 @@ end
function MAIL_SEND_SUCCESS()
if SendMail_state then
addAutoCompleteName(gsub(strlower(SendMail_state.to), '^%l', strupper))
addAutoCompleteName(SendMail_state.to)
end
SendMail_sending = false
end
@@ -514,6 +514,17 @@ function SendMail_Load()
function SendMailNameEditBox.focusLoss()
mailAutoCompleteBox:Hide()
end
do
local orig = SendMailNameEditBox:GetScript'OnTextChanged'
SendMailNameEditBox:SetScript('OnTextChanged', function()
local text = this:GetText()
local formatted = gsub(strlower(text), '^%l', strupper)
if text ~= formatted then
this:SetText(formatted)
end
return orig()
end)
end
for _, editBox in {SendMailNameEditBox, SendMailSubjectEditBox} do
editBox:SetScript('OnEditFocusGained', function()