Save and open new contact on click
This commit is contained in:
parent
17f3263a21
commit
87cd3f5053
2 changed files with 12 additions and 2 deletions
|
@ -50,10 +50,19 @@
|
|||
'keyup': 'keyup',
|
||||
'click .back button': 'hideCompose',
|
||||
'click .fab': 'showCompose',
|
||||
'open .contact': 'openConversation'
|
||||
'open #contacts': 'openConversation',
|
||||
'open .contacts': 'openConversation',
|
||||
'open .new-contact': 'createConversation',
|
||||
},
|
||||
openConversation: function(e, data) {
|
||||
bg.openConversation(data.modelId);
|
||||
this.hideCompose();
|
||||
},
|
||||
createConversation: function(e, data) {
|
||||
this.newConversationView.new_contact.model.save().then(function() {
|
||||
bg.openConversation(data.modelId);
|
||||
});
|
||||
this.hideCompose();
|
||||
},
|
||||
showCompose: function() {
|
||||
this.$fab.hide();
|
||||
|
|
|
@ -59,7 +59,8 @@ var Whisper = Whisper || {};
|
|||
|
||||
this.new_contact = new Whisper.ConversationListItemView({
|
||||
model: new Whisper.Conversation({
|
||||
active_at: null
|
||||
active_at: null,
|
||||
type: 'private'
|
||||
})
|
||||
}).render();
|
||||
this.$el.find('.new-contact').append(this.new_contact.el);
|
||||
|
|
Loading…
Reference in a new issue