1
0
mirror of https://github.com/flarum/core.git synced 2025-07-26 03:01:22 +02:00
Files
php-flarum/extensions/mentions/js/src/forum/addPostReplyAction.js
Alexander Skvortsov ea56f39a53 Mithril 2 Update (#52)
Update for Mithril 2

- Please note that PostQuoteButton and AutocompleteDropdown are not Fragments, not Components. Accordingly, they have been moved to the components folder.

Co-authored-by: Matthew Kilgore <tankerkiller125@gmail.com>
Co-authored-by: Franz Liedke <franz@develophp.org>
2020-09-23 22:53:46 -04:00

21 lines
602 B
JavaScript

import { extend } from 'flarum/extend';
import Button from 'flarum/components/Button';
import CommentPost from 'flarum/components/CommentPost';
import reply from './utils/reply';
export default function () {
extend(CommentPost.prototype, 'actionItems', function (items) {
const post = this.attrs.post;
if (post.isHidden() || (app.session.user && !post.discussion().canReply())) return;
items.add('reply',
<Button className='Button Button--link' onclick={() => reply(post)}>
{app.translator.trans('flarum-mentions.forum.post.reply_link')}
</Button>
);
});
}