Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var timer;
- $('#text').keypress(function (e) {
- var self = this;
- var code = e.keyCode || e.which;
- if (code == 13) {
- event.preventDefault();
- clearTimeout(timer);
- text = $('#text').val();
- $('#text').val('');
- timer = setTimeout(function(){
- socket.emit('text', { msg: text, room: '{{channel.channelLoc}}' });
- },2000)
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement