ui: auto mention when reply

This commit is contained in:
undefined committed 2021-09-20 23:34:21 +08:00
1 parent 9a1d39a693
commit 1ddde7d090
3 files changed
+7 -7

No files matched your search

@@ -109,14 +109,14 @@ async function onCommentClickReplyComment(ev, options = {}) {
async function onCommentClickReplyReply(ev) {
const $evTarget = $(ev.currentTarget);
const $mediaBody = $evTarget.closest('.media__body');
const username = $mediaBody
.find('.user-profile-name').eq(0)
.text();
const uid = $mediaBody
.find('.user-profile-name')
.attr('href').split('/user/')[1];
$evTarget
.closest('.dczcomments__item')
.find('[name="dczcomments__op-reply-comment"]').eq(0)
.trigger('click', { initialText: `@${username.trim()}: ` });
.trigger('click', { initialText: `@[](/user/${uid.trim()}) ` });
}
async function onCommentClickEdit(mode, ev) {