Skip to content

Commit e7ab119

Browse files
refactor(core): improve extensibility of CommentPost
1 parent b3366e4 commit e7ab119

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

framework/core/js/src/forum/components/CommentPost.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,22 @@ export default class CommentPost extends Post {
5151
<header className="Post-header">
5252
<ul>{listItems(this.headerItems().toArray())}</ul>
5353
</header>,
54-
<div className="Post-body">
55-
{this.isEditing() ? <ComposerPostPreview className="Post-preview" composer={app.composer} /> : m.trust(this.attrs.post.contentHtml())}
56-
</div>,
54+
<div className="Post-body">{this.contentItems().toArray()}</div>,
5755
]);
5856
}
5957

58+
contentItems() {
59+
const items = new ItemList();
60+
61+
items.add(
62+
'content',
63+
this.isEditing() ? <ComposerPostPreview className="Post-preview" composer={app.composer} /> : m.trust(this.attrs.post.contentHtml()),
64+
100
65+
);
66+
67+
return items;
68+
}
69+
6070
refreshContent() {
6171
const contentHtml = this.isEditing() ? '' : this.attrs.post.contentHtml();
6272

0 commit comments

Comments
 (0)