1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-10-31 14:10:08 +00:00

Fix uncaught TypeError in Safari 8

jQuery's “.focus()” returns undefined in Safari 8, thus the following error will be thrown and sending of messages is impossible: “Uncaught TypeError: Cannot read property 'change' of undefined”
This commit is contained in:
Maximilian Mader 2015-09-26 23:27:41 +02:00
parent dc56c5a152
commit a9c2e4fe30

View File

@ -190,7 +190,10 @@ and afterwards sent to the server by an AJAX request.
do event.preventDefault do event.preventDefault
text = do $('#timsChatInput').val().trim text = do $('#timsChatInput').val().trim
$('#timsChatInput').val('').focus().change() input = $ '#timsChatInput'
input.val ''
do input.focus
do input.change
return false if text.length is 0 return false if text.length is 0