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.delegateEvents();
|
||||||
}
|
}
|
||||||
this.view.render();
|
this.view.render();
|
||||||
|
this.$el.addClass('selected');
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
|
|
@ -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;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -22,6 +22,10 @@ body {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.contact.selected {
|
||||||
|
background-color: aliceblue;
|
||||||
|
}
|
||||||
|
|
||||||
.conversation {
|
.conversation {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
Loading…
Reference in a new issue