Simplify event arguments
// FREEBIE
This commit is contained in:
parent
c8a76ab38e
commit
4a482243d0
5 changed files with 8 additions and 9 deletions
|
@ -16,7 +16,7 @@
|
|||
view.$el.prependTo(bg.$('body',document));
|
||||
window.openConversation = function(conversation) {
|
||||
if (conversation) {
|
||||
view.openConversation(null, {conversation: conversation});
|
||||
view.openConversation(null, conversation);
|
||||
}
|
||||
};
|
||||
openConversation(bg.getOpenConversation());
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
select: function(e) {
|
||||
this.$el.addClass('selected').siblings('.selected').removeClass('selected');
|
||||
this.$el.trigger('select', {conversation: this.model});
|
||||
this.$el.trigger('select', this.model);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
|
|
|
@ -111,8 +111,7 @@
|
|||
'click .show-new-conversation': 'showCompose',
|
||||
'select .gutter .contact': 'openConversation'
|
||||
},
|
||||
openConversation: function(e, data) {
|
||||
var conversation = data.conversation;
|
||||
openConversation: function(e, conversation) {
|
||||
this.conversation_stack.open(conversation);
|
||||
this.hideCompose();
|
||||
},
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
var id = this.getRecipients().at(0).id;
|
||||
ConversationController.findOrCreatePrivateById(id).then(function(conversation) {
|
||||
conversation.save('active_at', Date.now());
|
||||
this.trigger('open', { conversation: conversation });
|
||||
this.trigger('open', conversation);
|
||||
}.bind(this));
|
||||
}
|
||||
},
|
||||
|
@ -112,7 +112,7 @@
|
|||
};
|
||||
var group = ConversationController.create(attributes);
|
||||
group.save().then(function() {
|
||||
this.trigger('open', { conversation: group });
|
||||
this.trigger('open', group);
|
||||
}.bind(this));
|
||||
var now = Date.now();
|
||||
var message = group.messageCollection.add({
|
||||
|
|
|
@ -136,14 +136,14 @@
|
|||
}).render();
|
||||
},
|
||||
|
||||
addNewRecipient: function(e, data) {
|
||||
addNewRecipient: function() {
|
||||
this.recipients.add(this.new_contact_view.model);
|
||||
this.initNewContact();
|
||||
this.resetTypeahead();
|
||||
},
|
||||
|
||||
addRecipient: function(e, data) {
|
||||
this.recipients.add(this.typeahead.remove(data.conversation.id));
|
||||
addRecipient: function(e, conversation) {
|
||||
this.recipients.add(this.typeahead.remove(conversation.id));
|
||||
this.resetTypeahead();
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue