Skip to content

Commit

Permalink
Send message on keydown
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Sep 6, 2014
1 parent 2b034b5 commit f53d4f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lhc_web/design/defaulttheme/tpl/lhchat/chatwidget.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,12 @@
<script>
jQuery('#id_Question').addClass('mb0');
var formSubmitted = false;
jQuery('#id_Question').bind('keyup', 'return', function (evt){
jQuery('#id_Question').bind('keydown', 'return', function (evt){
if (formSubmitted == false) {
formSubmitted = true;
$( "#form-start-chat" ).submit();
}
};
return false;
});
</script>
<?php endif;?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@

<script>
var formSubmitted = false;
jQuery('#id_Question').bind('keyup', 'return', function (evt){
jQuery('#id_Question').bind('keydown', 'return', function (evt){
if (formSubmitted == false) {
formSubmitted = true;
$( "#ReadOperatorMessage" ).submit();
}
};
return false;
});
<?php if ($playsound == true) : ?>
$(function() {lhinst.playInvitationSound();});
Expand Down

0 comments on commit f53d4f4

Please sign in to comment.