mirror of
https://github.com/flarum/core.git
synced 2025-10-15 00:44:40 +02:00
Run prettier for all JS files
This commit is contained in:
@@ -24,7 +24,7 @@ export default class ReplyComposer extends ComposerBody {
|
||||
init() {
|
||||
super.init();
|
||||
|
||||
this.editor.props.preview = e => {
|
||||
this.editor.props.preview = (e) => {
|
||||
minimizeComposerIfFullScreen(e);
|
||||
|
||||
m.route(app.route.discussion(this.props.discussion, 'reply'));
|
||||
@@ -43,18 +43,21 @@ export default class ReplyComposer extends ComposerBody {
|
||||
const items = super.headerItems();
|
||||
const discussion = this.props.discussion;
|
||||
|
||||
const routeAndMinimize = function(element, isInitialized) {
|
||||
const routeAndMinimize = function (element, isInitialized) {
|
||||
if (isInitialized) return;
|
||||
$(element).on('click', minimizeComposerIfFullScreen);
|
||||
m.route.apply(this, arguments);
|
||||
};
|
||||
|
||||
items.add('title', (
|
||||
items.add(
|
||||
'title',
|
||||
<h3>
|
||||
{icon('fas fa-reply')} {' '}
|
||||
<a href={app.route.discussion(discussion)} config={routeAndMinimize}>{discussion.title()}</a>
|
||||
{icon('fas fa-reply')}{' '}
|
||||
<a href={app.route.discussion(discussion)} config={routeAndMinimize}>
|
||||
{discussion.title()}
|
||||
</a>
|
||||
</h3>
|
||||
));
|
||||
);
|
||||
|
||||
return items;
|
||||
}
|
||||
@@ -67,7 +70,7 @@ export default class ReplyComposer extends ComposerBody {
|
||||
data() {
|
||||
return {
|
||||
content: this.content(),
|
||||
relationships: {discussion: this.props.discussion}
|
||||
relationships: { discussion: this.props.discussion },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -79,13 +82,14 @@ export default class ReplyComposer extends ComposerBody {
|
||||
|
||||
const data = this.data();
|
||||
|
||||
app.store.createRecord('posts').save(data).then(
|
||||
post => {
|
||||
app.store
|
||||
.createRecord('posts')
|
||||
.save(data)
|
||||
.then((post) => {
|
||||
// If we're currently viewing the discussion which this reply was made
|
||||
// in, then we can update the post stream and scroll to the post.
|
||||
if (app.viewingDiscussion(discussion)) {
|
||||
app.current.stream.update().then(() => app.current.stream.goToNumber(post.number()));
|
||||
|
||||
} else {
|
||||
// Otherwise, we'll create an alert message to inform the user that
|
||||
// their reply has been posted, containing a button which will
|
||||
@@ -97,20 +101,18 @@ export default class ReplyComposer extends ComposerBody {
|
||||
onclick: () => {
|
||||
m.route(app.route.post(post));
|
||||
app.alerts.dismiss(alert);
|
||||
}
|
||||
},
|
||||
});
|
||||
app.alerts.show(
|
||||
alert = new Alert({
|
||||
(alert = new Alert({
|
||||
type: 'success',
|
||||
children: app.translator.trans('core.forum.composer_reply.posted_message'),
|
||||
controls: [viewButton]
|
||||
})
|
||||
controls: [viewButton],
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
||||
app.composer.hide();
|
||||
},
|
||||
this.loaded.bind(this)
|
||||
);
|
||||
}, this.loaded.bind(this));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user