From 8fe074430bda577758969f9c2d470776989abe7a Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 10 Jun 2020 11:10:39 +0200 Subject: [PATCH] REVERT: partly revert change to ensure context is the same (#10012) --- app/assets/javascripts/discourse/app/widgets/widget.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/app/widgets/widget.js b/app/assets/javascripts/discourse/app/widgets/widget.js index 378035ab7be..ad54150b33b 100644 --- a/app/assets/javascripts/discourse/app/widgets/widget.js +++ b/app/assets/javascripts/discourse/app/widgets/widget.js @@ -336,12 +336,12 @@ export default class Widget { sendWidgetAction(name, param) { return this.rerenderResult(() => { - const widgetFunction = this.callWidgetFunction(name, param); + const widget = this._findAncestorWithProperty(name); + if (widget) { + return widget[name].call(widget, param); + } - return ( - widgetFunction || - this._sendComponentAction(name, param || this.findAncestorModel()) - ); + return this._sendComponentAction(name, param || this.findAncestorModel()); }); }