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.render();
this.$el.addClass('selected');
},
render: function() {

View file

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

View file

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