Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

Commit

Permalink
Fixed: sending messages on emoji completer with enter key refs #160
Browse files Browse the repository at this point in the history
  • Loading branch information
mallowlabs committed Jan 3, 2014
1 parent 1106176 commit 077572b
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions app/assets/javascripts/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,17 @@ $(function() {

$('form.inputarea').bind('submit', function(e){
var textcompleting = $(".dropdown-menu").is(":visible");

if(connected && !textcompleting) {
e.preventDefault();
jQuery.post(AsakusaSatellite.url.create, {
'room_id' : AsakusaSatellite.current.room,
'message' : $('textarea#message').val()
});
$('textarea#message').val('');
} else if (e.target == $('textarea#message').get(0)) {
this.submit();
if (!textcompleting) {
if (connected) {
e.preventDefault();
jQuery.post(AsakusaSatellite.url.create, {
'room_id' : AsakusaSatellite.current.room,
'message' : $('textarea#message').val()
});
$('textarea#message').val('');
} else if (e.target == $('textarea#message').get(0)) {
this.submit();
}
}
});

Expand Down

0 comments on commit 077572b

Please sign in to comment.