1
0
mirror of https://github.com/flarum/core.git synced 2025-08-01 14:10:37 +02:00

Massive JavaScript cleanup

- Use JSX for templates
- Docblock/comment everything
- Mostly passes ESLint (still some work to do)
- Lots of renaming, refactoring, etc.

CSS hasn't been updated yet.
This commit is contained in:
Toby Zerner
2015-07-15 14:00:11 +09:30
parent 4480e0a83f
commit ab6c03c0cc
220 changed files with 9785 additions and 5919 deletions

View File

@@ -0,0 +1,33 @@
import Component from 'flarum/Component';
import avatar from 'flarum/helpers/avatar';
import DiscussionControls from 'flarum/utils/DiscussionControls';
/**
* The `ReplyPlaceholder` component displays a placeholder for a reply, which,
* when clicked, opens the reply composer.
*
* ### Props
*
* - `discussion`
*/
export default class ReplyPlaceholder extends Component {
view() {
function triggerClick(e) {
$(this).trigger('click');
e.preventDefault();
}
const reply = () => {
DiscussionControls.replyAction.call(this.props.discussion, true);
};
return (
<article className="post reply-post" onclick={reply} onmousedown={triggerClick}>
<header className="post-header">
{avatar(app.session.user)}
Write a Reply...
</header>
</article>
);
}
}