mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
added auto mention if u click post reply
This commit is contained in:
@@ -263,12 +263,20 @@ define(function() {
|
|||||||
|
|
||||||
if ($(selection.baseNode).parents('.post-content').length > 0) {
|
if ($(selection.baseNode).parents('.post-content').length > 0) {
|
||||||
var snippet = selection.toString();
|
var snippet = selection.toString();
|
||||||
if (snippet.length > 0) selectionText = '> ' + snippet.replace(/\n/g, '\n> ');
|
if (snippet.length > 0) {
|
||||||
|
selectionText = '> ' + snippet.replace(/\n/g, '\n> ');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var username = '',
|
||||||
|
post = $(this).parents('li[data-pid]');
|
||||||
|
if(post.length) {
|
||||||
|
username = '@' + post.attr('data-username') + ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thread_state.locked !== '1') {
|
if (thread_state.locked !== '1') {
|
||||||
require(['composer'], function(cmp) {
|
require(['composer'], function(cmp) {
|
||||||
cmp.push(tid, null, null, selectionText.length > 0 ? selectionText + '\n\n' : '');
|
cmp.push(tid, null, null, selectionText.length > 0 ? selectionText + '\n\n' + username : '' + username);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user