From b891ef34268c88136a8a5da93c33eb4f758161fb Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Sun, 16 Aug 2020 00:45:41 -0400 Subject: [PATCH] Revert "update for mithril 2" This reverts commit 1d4c935c16e404625441a95a51fccce6a45f8e48. --- extensions/approval/js/src/forum/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/approval/js/src/forum/index.js b/extensions/approval/js/src/forum/index.js index c398f3aa4..5034e0a60 100644 --- a/extensions/approval/js/src/forum/index.js +++ b/extensions/approval/js/src/forum/index.js @@ -21,20 +21,20 @@ app.initializers.add('flarum-approval', () => { Post.prototype.isApproved = Post.attribute('isApproved'); Post.prototype.canApprove = Post.attribute('canApprove'); - extend(DiscussionListItem.prototype, 'elementAttrs', function(attrs) { - if (!this.attrs.discussion.isApproved()) { + extend(DiscussionListItem.prototype, 'attrs', function(attrs) { + if (!this.props.discussion.isApproved()) { attrs.className += ' DiscussionListItem--unapproved'; } }); - extend(PostComponent.prototype, 'elementAttrs', function(attrs) { - if (!this.attrs.post.isApproved()) { + extend(PostComponent.prototype, 'attrs', function(attrs) { + if (!this.props.post.isApproved()) { attrs.className += ' Post--unapproved'; } }); extend(CommentPost.prototype, 'headerItems', function(items) { - if (!this.attrs.post.isApproved() && !this.attrs.post.isHidden()) { + if (!this.props.post.isApproved() && !this.props.post.isHidden()) { items.add('unapproved', app.translator.trans('flarum-approval.forum.post.awaiting_approval_text')); } });