mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
A helper for cooked content in a decorator
This commit is contained in:
parent
65553d7b70
commit
fdf0047f56
@ -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;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user