mirror of
https://github.com/flarum/core.git
synced 2025-08-17 22:01:44 +02:00
[1.x] [extensibility] refactor(core, flags): improve & use extensibility of CommentPost
& Post
(#4047)
* refactor(core): improve extensibility of `CommentPost` * refactor(core): rename method to more appropriate name * refactor(core): further improve extensibility of `CommentPost` * refactor(core): improve extensibility of `Post` * refactor(flags): use new extensibility for flagged posts
This commit is contained in:
@@ -75,7 +75,7 @@ export default function () {
|
||||
return items;
|
||||
};
|
||||
|
||||
extend(Post.prototype, 'content', function (vdom) {
|
||||
extend(Post.prototype, 'viewItems', function (items) {
|
||||
const post = this.attrs.post;
|
||||
const flags = post.flags();
|
||||
|
||||
@@ -83,7 +83,8 @@ export default function () {
|
||||
|
||||
if (post.isHidden()) this.revealContent = true;
|
||||
|
||||
vdom.unshift(
|
||||
items.add(
|
||||
'flagged',
|
||||
<div className="Post-flagged">
|
||||
<div className="Post-flagged-flags">
|
||||
{flags.map((flag) => (
|
||||
@@ -91,7 +92,8 @@ export default function () {
|
||||
))}
|
||||
</div>
|
||||
<div className="Post-flagged-actions">{this.flagActionItems().toArray()}</div>
|
||||
</div>
|
||||
</div>,
|
||||
110
|
||||
);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user