Highlight the selected thread

This commit is contained in:
lilia 2014-10-22 17:26:37 -07:00
parent 19dac1f3df
commit d67b723f4f
3 changed files with 8 additions and 6 deletions

View file

@ -27,6 +27,7 @@ var Whisper = Whisper || {};
this.view.delegateEvents(); this.view.delegateEvents();
} }
this.view.render(); this.view.render();
this.$el.addClass('selected');
}, },
render: function() { render: function() {

View file

@ -10,15 +10,12 @@ var Whisper = Whisper || {};
collection: Whisper.Threads, collection: Whisper.Threads,
events: { events: {
'click .conversation': 'select', 'click .contact': 'select',
}, },
select: function(e) { select: function(e) {
var target = $(e.target).closest('.conversation'); var target = $(e.target).closest('.contact');
if (!target.is('.selected')) { target.siblings().removeClass('selected');
target.siblings().removeClass('slected');
target.addClass('selected');
}
return false; return false;
}, },
}); });

View file

@ -22,6 +22,10 @@ body {
display: none; display: none;
} }
.contact.selected {
background-color: aliceblue;
}
.conversation { .conversation {
margin: 0; margin: 0;
padding: 0; padding: 0;