From 8837fe47d77a6218cce0644a87fbd7718aa2d6bc Mon Sep 17 00:00:00 2001 From: Dan Ungureanu Date: Sun, 4 Nov 2018 11:22:22 +0200 Subject: [PATCH] DEV: Add app event triggered when composer's reply is reloaded. --- app/assets/javascripts/discourse/models/composer.js.es6 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/javascripts/discourse/models/composer.js.es6 b/app/assets/javascripts/discourse/models/composer.js.es6 index 45993627c2f..230cbffecf8 100644 --- a/app/assets/javascripts/discourse/models/composer.js.es6 +++ b/app/assets/javascripts/discourse/models/composer.js.es6 @@ -686,6 +686,8 @@ const Composer = RestModel.extend({ originalText: post.get("raw"), loading: false }); + + composer.appEvents.trigger("composer:reply-reloaded", composer); }); } else if (opts.action === REPLY && opts.quote) { this.setProperties({ @@ -701,6 +703,10 @@ const Composer = RestModel.extend({ this.set("originalTitle", this.get("title")); } + if (!isEdit(opts.action) || !opts.post) { + composer.appEvents.trigger("composer:reply-reloaded", composer); + } + return false; },