For @Sam - hide the poster expansion if you click on the avatar of the user who's expanded

This commit is contained in:
Robin Ward 2013-10-10 12:03:04 -04:00
parent ae72724648
commit ea9398467b
1 changed files with 5 additions and 2 deletions

View File

@ -24,11 +24,14 @@ Discourse.PosterExpansionController = Discourse.ObjectController.extend({
return;
}
var currentUsername = this.get('username');
var currentPostId = this.get('id');
this.setProperties({model: post, visible: true});
// If we're showing the same user we showed last time, just keep it
if (post.get('username') === currentUsername) { return; }
if (post.get('id') === currentPostId) {
this.setProperties({ visible: false, model: null });
return;
}
this.set('participant', null);