FIX: Some re-render functionality in widgets, added more coverage

This commit is contained in:
Robin Ward
2016-02-26 14:01:20 -05:00
parent c2c4eff08b
commit 98ab64dc89
6 changed files with 223 additions and 23 deletions
@@ -1,6 +1,6 @@
import { diff, patch } from 'virtual-dom';
import { WidgetClickHook } from 'discourse/widgets/click-hook';
import { renderedKey } from 'discourse/widgets/widget';
import { renderedKey, queryRegistry } from 'discourse/widgets/widget';
const _cleanCallbacks = {};
export function addWidgetCleanCallback(widgetName, fn) {
@@ -17,7 +17,9 @@ export default Ember.Component.extend({
init() {
this._super();
this._widgetClass = this.container.lookupFactory(`widget:${this.get('widget')}`);
const name = this.get('widget');
this._widgetClass = queryRegistry(name) || this.container.lookupFactory(`widget:${name}`);
this._connected = [];
},