A helper for cooked content in a decorator

This commit is contained in:
Robin Ward 2016-02-22 15:19:56 -05:00
parent 65553d7b70
commit fdf0047f56

View File

@ -1,5 +1,6 @@
import Connector from 'discourse/widgets/connector'; import Connector from 'discourse/widgets/connector';
import { h } from 'virtual-dom'; import { h } from 'virtual-dom';
import PostCooked from 'discourse/widgets/post-cooked';
class DecoratorHelper { class DecoratorHelper {
constructor(widget, attrs, state) { constructor(widget, attrs, state) {
@ -15,6 +16,10 @@ class DecoratorHelper {
getModel() { getModel() {
return this.widget.findAncestorModel(); return this.widget.findAncestorModel();
} }
cooked(cooked) {
return new PostCooked({ cooked });
}
} }
DecoratorHelper.prototype.h = h; DecoratorHelper.prototype.h = h;