mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Don't insert text if the allowed length would be exceeded
This commit is contained in:
parent
b633f05452
commit
b8bc642714
@ -767,6 +767,10 @@ 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'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user