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

Commit

Permalink
Merge pull request #184 from mallowlabs/id/184
Browse files Browse the repository at this point in the history
Fix sending empty message
  • Loading branch information
mzp committed Apr 22, 2014
2 parents 44232c7 + fe4e767 commit 5e6730b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/assets/javascripts/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@ $(function() {
$('form.inputarea').bind('submit', function(e){
var textcompleting = $(".dropdown-menu").is(":visible");
if (!textcompleting) {
var message = $('textarea#message').val();
if (message == '' || message == null) {
return;
}
if (connected) {
e.preventDefault();
jQuery.post(AsakusaSatellite.url.create, {
'room_id' : AsakusaSatellite.current.room,
'message' : $('textarea#message').val()
'message' : message
});
$('textarea#message').val('');
} else if (e.target == $('textarea#message').get(0)) {
Expand Down

0 comments on commit 5e6730b

Please sign in to comment.