mirror of
https://github.com/flarum/core.git
synced 2025-08-03 23:17:43 +02:00
Webpack (#33)
See https://github.com/flarum/core/pull/1367 * Replace gulp with webpack and npm scripts for JS compilation * Set up Travis CI to commit compiled JS * Restructure `js` directory; only one instance of npm, forum/admin are "submodules" * Restructure `less` directory
This commit is contained in:
22
extensions/mentions/js/src/forum/addPostReplyAction.js
Normal file
22
extensions/mentions/js/src/forum/addPostReplyAction.js
Normal file
@@ -0,0 +1,22 @@
|
||||
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.props.post;
|
||||
|
||||
if (post.isHidden() || (app.session.user && !post.discussion().canReply())) return;
|
||||
|
||||
items.add('reply',
|
||||
Button.component({
|
||||
className: 'Button Button--link',
|
||||
children: app.translator.trans('flarum-mentions.forum.post.reply_link'),
|
||||
onclick: () => reply(post)
|
||||
})
|
||||
);
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user