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.
This commit is contained in:
parent
607d5d3307
commit
34d5f3e88a
2 changed files with 2 additions and 22 deletions
|
@ -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() {
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue