Expose reopenWidget through plugin api

This commit is contained in:
James Kiesel 2017-01-17 08:19:29 +13:00
parent 513f570936
commit 646b49e5ae
1 changed files with 11 additions and 1 deletions

View File

@ -5,7 +5,7 @@ import { addButton } from 'discourse/widgets/post-menu';
import { includeAttributes } from 'discourse/lib/transform-post'; import { includeAttributes } from 'discourse/lib/transform-post';
import { addToolbarCallback } from 'discourse/components/d-editor'; import { addToolbarCallback } from 'discourse/components/d-editor';
import { addWidgetCleanCallback } from 'discourse/components/mount-widget'; import { addWidgetCleanCallback } from 'discourse/components/mount-widget';
import { createWidget, decorateWidget, changeSetting } from 'discourse/widgets/widget'; import { createWidget, reopenWidget, decorateWidget, changeSetting } from 'discourse/widgets/widget';
import { onPageChange } from 'discourse/lib/page-tracker'; import { onPageChange } from 'discourse/lib/page-tracker';
import { preventCloak } from 'discourse/widgets/post-stream'; import { preventCloak } from 'discourse/widgets/post-stream';
import { h } from 'virtual-dom'; import { h } from 'virtual-dom';
@ -307,6 +307,16 @@ class PluginApi {
return createWidget(name, args); return createWidget(name, args);
} }
/**
* Exposes the widget update ability to plugins. Updates the widget
* registry for the given widget name to include the properties on args
* See `reopenWidget` in `discourse/widgets/widget` from more ifo.
**/
reopenWidget(name, args) {
return reopenWidget(name, args);
}
/** /**
* Adds a property that can be summed for calculating the flag counter * Adds a property that can be summed for calculating the flag counter
**/ **/