From 3a099657e62f4d9697fbb93724ea4a0226ae455b Mon Sep 17 00:00:00 2001 From: lilia Date: Sun, 8 Feb 2015 08:44:31 -1000 Subject: [PATCH] Untangle select vs open events --- js/views/conversation_list_item_view.js | 6 +++--- js/views/inbox_view.js | 4 ++-- js/views/new_conversation_view.js | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/js/views/conversation_list_item_view.js b/js/views/conversation_list_item_view.js index de66b5a5..b3130a1c 100644 --- a/js/views/conversation_list_item_view.js +++ b/js/views/conversation_list_item_view.js @@ -25,7 +25,7 @@ var Whisper = Whisper || {}; className: 'contact', events: { - 'click': 'open' + 'click': 'select' }, initialize: function() { this.template = $('#contact').html(); @@ -35,9 +35,9 @@ var Whisper = Whisper || {}; this.listenTo(this.model, 'destroy', this.remove); // auto update }, - open: function(e) { + select: function(e) { this.$el.addClass('selected'); - this.$el.trigger('open', {modelId: this.model.id}); + this.$el.trigger('select', {modelId: this.model.id}); }, render: function() { diff --git a/js/views/inbox_view.js b/js/views/inbox_view.js index 987c833c..50c5bf73 100644 --- a/js/views/inbox_view.js +++ b/js/views/inbox_view.js @@ -50,8 +50,8 @@ 'keyup': 'keyup', 'click .back button': 'hideCompose', 'click .fab': 'showCompose', - 'open #contacts': 'openConversation', - 'open .new-conversation .contacts': 'openConversation' + 'select #contacts .contact': 'openConversation', + 'open .new-conversation': 'openConversation' }, openConversation: function(e, data) { bg.openConversation(data.modelId); diff --git a/js/views/new_conversation_view.js b/js/views/new_conversation_view.js index 003ab193..6cfc3157 100644 --- a/js/views/new_conversation_view.js +++ b/js/views/new_conversation_view.js @@ -105,8 +105,8 @@ var Whisper = Whisper || {}; events: { 'change input.new-message': 'filterContacts', 'keyup input.new-message': 'filterContacts', - 'open .new-contact': 'addNewRecipient', - 'open .contacts': 'addRecipient', + 'select .new-contact': 'addNewRecipient', + 'select .contacts': 'addRecipient', 'remove .recipient': 'removeRecipient', 'click .create': 'create' }, @@ -203,7 +203,7 @@ var Whisper = Whisper || {}; var id = getString(groupId); var group = new Whisper.Conversation(attributes); group.save({ id: id, groupId: id }).then(function() { - this.$group_update.trigger('open', {modelId: id}); + this.$el.trigger('open', {modelId: id}); }.bind(this)); }.bind(this)); }.bind(this));