Skip to content

Commit

Permalink
Checks for empty message by trim()ing the input
Browse files Browse the repository at this point in the history
Signed-off-by: Akash Manohar J <akash@akash.im>
  • Loading branch information
HashNuke committed Apr 13, 2012
1 parent 74285fd commit 1ef504f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/assets/javascripts/backbone/views/chatbox.js.coffee
Expand Up @@ -16,8 +16,11 @@ class Kandan.Views.Chatbox extends Backbone.View

postMessage: (event)->
$chatbox = $(event.target).parent().find(".chat-input")
chatInput = $chatbox.val()
return false if chatInput.trim().length==0

activity = new Kandan.Models.Activity({
'content': $chatbox.val(),
'content': chatInput,
'action': 'message',
'channel_id': @channel.get('id')
})
Expand Down

0 comments on commit 1ef504f

Please sign in to comment.