Add preview button to composer

This commit is contained in:
Toby Zerner
2015-07-28 13:34:42 +09:30
parent 8c18ff3349
commit e2a4cf5ccb
9 changed files with 47 additions and 7 deletions

View File

@ -13,6 +13,14 @@ import icon from 'flarum/helpers/icon';
* - `discussion`
*/
export default class ReplyComposer extends ComposerBody {
constructor(...args) {
super(...args);
this.editor.props.preview = () => {
m.route(app.route.discussion(this.props.discussion, 'reply'));
};
}
static initProps(props) {
super.initProps(props);
@ -92,6 +100,7 @@ export default class ReplyComposer extends ComposerBody {
// transition to their new post when clicked.
let alert;
const viewButton = Button.component({
className: 'Button Button--link',
children: app.trans('core.view'),
onclick: () => {
m.route(app.route.post(post));