mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 07:46:16 +08:00
DEV: This constructs a pluginId
for modifyClass
when dispatching events
It also helpfully adds the `ignoreMissing` option which was causing logging issues on optional modifications before.
This commit is contained in:
parent
f0d2b0f2f0
commit
ea84c66fe0
|
@ -1387,12 +1387,17 @@ class PluginApi {
|
||||||
* is converted to camelCase and used as the method name for you.
|
* is converted to camelCase and used as the method name for you.
|
||||||
*/
|
*/
|
||||||
dispatchWidgetAppEvent(mountedComponent, widgetKey, appEvent) {
|
dispatchWidgetAppEvent(mountedComponent, widgetKey, appEvent) {
|
||||||
this.modifyClass(`component:${mountedComponent}`, {
|
this.modifyClass(
|
||||||
|
`component:${mountedComponent}`,
|
||||||
|
{
|
||||||
|
pluginId: `#{mountedComponent}/#{widgetKey}/#{appEvent}`,
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
this._super();
|
this._super();
|
||||||
this.dispatch(appEvent, widgetKey);
|
this.dispatch(appEvent, widgetKey);
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
|
{ ignoreMissing: true }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user