Get messages sending with new ui

Also convert index.html to 4-space indentation.
This commit is contained in:
lilia 2014-07-27 14:49:02 -10:00
parent 95c31629b7
commit 44f272a181
3 changed files with 111 additions and 108 deletions

View file

@ -21,10 +21,10 @@ var Whisper = Whisper || {};
},
open: function(e) {
$('#main').trigger('close'); // detach any existing conversation views
$('#conversation').trigger('close'); // detach any existing conversation views
if (!this.view) {
this.view = new Whisper.ConversationView({
el: $('#main'),
el: $('#conversation'),
model: this.model
});
} else {

View file

@ -10,13 +10,13 @@ var Whisper = Whisper || {};
this.view = new Whisper.MessageListView({collection: this.model.messages()});
},
events: {
'submit #new-message': 'sendMessage',
'submit #send': 'sendMessage',
'close': 'undelegateEvents'
},
sendMessage: function(e) {
e.preventDefault();
var input = $('#new-message-text');
var input = this.$el.find('#send input');
if (input.val().length > 0) {
this.model.sendMessage(input.val());
input.val("");