Highlight the selected thread
This commit is contained in:
parent
19dac1f3df
commit
d67b723f4f
3 changed files with 8 additions and 6 deletions
|
@ -27,6 +27,7 @@ var Whisper = Whisper || {};
|
|||
this.view.delegateEvents();
|
||||
}
|
||||
this.view.render();
|
||||
this.$el.addClass('selected');
|
||||
},
|
||||
|
||||
render: function() {
|
||||
|
|
|
@ -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;
|
||||
},
|
||||
});
|
||||
|
|
|
@ -22,6 +22,10 @@ body {
|
|||
display: none;
|
||||
}
|
||||
|
||||
.contact.selected {
|
||||
background-color: aliceblue;
|
||||
}
|
||||
|
||||
.conversation {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
|
Loading…
Reference in a new issue