From ea9398467b2ebafb9451646387ed46b19f532cc4 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 10 Oct 2013 12:03:04 -0400 Subject: [PATCH] For @Sam - hide the poster expansion if you click on the avatar of the user who's expanded --- .../discourse/controllers/poster_expansion_controller.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/poster_expansion_controller.js b/app/assets/javascripts/discourse/controllers/poster_expansion_controller.js index a7d89d8335d..6ce6de85645 100644 --- a/app/assets/javascripts/discourse/controllers/poster_expansion_controller.js +++ b/app/assets/javascripts/discourse/controllers/poster_expansion_controller.js @@ -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);