mirror of
https://github.com/flarum/core.git
synced 2025-07-28 20:20:34 +02:00
Reset original content before inserting the mention
This commit is contained in:
@@ -16,7 +16,6 @@ export default function() {
|
|||||||
if (component) {
|
if (component) {
|
||||||
var quote = window.getSelection().toString();
|
var quote = window.getSelection().toString();
|
||||||
var mention = '@'+post.user().username()+'#'+post.number()+' ';
|
var mention = '@'+post.user().username()+'#'+post.number()+' ';
|
||||||
component.editor.insertAtCursor((component.editor.value() ? '\n\n' : '')+(quote ? '> '+mention+quote+'\n\n' : mention));
|
|
||||||
|
|
||||||
// If the composer is empty, then assume we're starting a new reply.
|
// If the composer is empty, then assume we're starting a new reply.
|
||||||
// In which case we don't want the user to have to confirm if they
|
// In which case we don't want the user to have to confirm if they
|
||||||
@@ -24,6 +23,8 @@ export default function() {
|
|||||||
if (!component.content()) {
|
if (!component.content()) {
|
||||||
component.props.originalContent = mention;
|
component.props.originalContent = mention;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
component.editor.insertAtCursor((component.editor.value() ? '\n\n' : '')+(quote ? '> '+mention+quote+'\n\n' : mention));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user