Revert "update for mithril 2"

This reverts commit 1d4c935c16.
This commit is contained in:
Alexander Skvortsov 2020-08-16 00:45:41 -04:00
parent fe5732e3af
commit b891ef3426

View File

@ -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'));
}
});