mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-21 21:30:08 +00:00
Don't insert text if the allowed length would be exceeded
This commit is contained in:
parent
b633f05452
commit
b8bc642714
@ -767,9 +767,13 @@ the existing text. If `options.submit` is true the message will be sent to the s
|
||||
text = text + $('#timsChatInput').val() if options.prepend
|
||||
text = $('#timsChatInput').val() + text if options.append
|
||||
|
||||
# do not insert text if it would exceed the allowed length
|
||||
maxLength = $('#timsChatInput').attr 'maxlength'
|
||||
return if maxLength? and text.length > maxLength
|
||||
|
||||
$('#timsChatInput').val text
|
||||
$('#timsChatInput').trigger 'change'
|
||||
|
||||
|
||||
if options.submit
|
||||
do $('#timsChatForm').submit
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user