From 30eed4c8b46ec6a80dba10116523e1cd52f47f5c Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 10 Sep 2013 20:00:04 -0400 Subject: [PATCH] FIX: Showing suggested topics when composing a reply --- .../javascripts/discourse/controllers/composer_controller.js | 3 +++ .../discourse/controllers/composer_messages_controller.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/app/assets/javascripts/discourse/controllers/composer_controller.js b/app/assets/javascripts/discourse/controllers/composer_controller.js index 99805553faa..c289c57bb8d 100644 --- a/app/assets/javascripts/discourse/controllers/composer_controller.js +++ b/app/assets/javascripts/discourse/controllers/composer_controller.js @@ -198,6 +198,9 @@ Discourse.ComposerController = Discourse.Controller.extend({ open: function(opts) { if (!opts) opts = {}; + var composerMessages = this.get('controllers.composerMessages'); + composerMessages.reset(); + var promise = opts.promise || Ember.Deferred.create(); opts.promise = promise; this.set('typedReply', false); diff --git a/app/assets/javascripts/discourse/controllers/composer_messages_controller.js b/app/assets/javascripts/discourse/controllers/composer_messages_controller.js index 1f4b1bcf126..ccfe883c656 100644 --- a/app/assets/javascripts/discourse/controllers/composer_messages_controller.js +++ b/app/assets/javascripts/discourse/controllers/composer_messages_controller.js @@ -26,6 +26,11 @@ Discourse.ComposerMessagesController = Ember.ArrayController.extend({ closeMessage: function(message) { this.removeObject(message); + }, + + reset: function() { + this.clear(); + this.set('messagesByTemplate', {}); } }); \ No newline at end of file