From 34d5f3e88ac1b61fdd4e98cf644c7d94b6d7d1a6 Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 21 Jan 2015 23:29:19 -1000 Subject: [PATCH] Cleanup inbox view Don't auto open the last conversation. It doesn't make sense now that we no longer have two column layout. Don't trigger/listen for selected events. There's no need since the list item opens a new popup now. --- js/views/conversation_list_item_view.js | 12 +----------- js/views/inbox_view.js | 12 +----------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/js/views/conversation_list_item_view.js b/js/views/conversation_list_item_view.js index cc0d281a..2d8ae744 100644 --- a/js/views/conversation_list_item_view.js +++ b/js/views/conversation_list_item_view.js @@ -20,7 +20,6 @@ var Whisper = Whisper || {}; 'use strict'; var bg = extension.windows.getBackground(); - // list of conversations, showing user/group and last message sent Whisper.ConversationListItemView = Backbone.View.extend({ tagName: 'div', @@ -39,17 +38,8 @@ var Whisper = Whisper || {}; }, open: function(e) { - var modelId = this.model.id; - this.$el.addClass('selected'); - - if (!this.view) { - this.view = new Whisper.ConversationView({ model: this.model }); - } - - bg.openConversation(modelId); - - this.model.collection.trigger('selected', this.view); + bg.openConversation(this.model.id); }, render: function() { diff --git a/js/views/inbox_view.js b/js/views/inbox_view.js index 7cffb296..00f4c309 100644 --- a/js/views/inbox_view.js +++ b/js/views/inbox_view.js @@ -30,23 +30,13 @@ collection : this.conversations }); - this.conversations.fetchActive({reset: true}).then(function() { - if (this.conversations.length) { - this.conversations.at(0).trigger('open'); - } - }.bind(this)); + this.conversations.fetchActive({reset: true}); extension.on('message', function(message) { this.conversations.fetch({id: message.conversationId}).then(function() { this.conversations.get(message.conversationId).fetchMessages(); }.bind(this)); }.bind(this)); - - this.conversations.on('selected', function(view) { - $('.conversation').hide().trigger('close'); // detach any existing conversation views - this.setContent(view.$el.show()); - view.render(); - }, this); }, events: { 'click #new-message': 'new_message',