mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
click on 'answered' to put the username of the respective comment into the editor as a mention.
This commit is contained in:
parent
490fb7fdeb
commit
28839ee2b4
@ -56,7 +56,7 @@
|
||||
<ds-space margin-bottom="small" />
|
||||
</ds-card>
|
||||
<ds-button
|
||||
v-bind:title="antworten"
|
||||
v-bind:title="answered"
|
||||
icon="level-down"
|
||||
style="float:right; top: -22px;"
|
||||
@click.prevent="answerComment"
|
||||
@ -86,6 +86,7 @@ export default {
|
||||
isTarget,
|
||||
isCollapsed: !isTarget,
|
||||
openEditCommentMenu: false,
|
||||
answered: this.$t('post.comment.answered'),
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@ -176,19 +177,20 @@ export default {
|
||||
}
|
||||
},
|
||||
answerComment() {
|
||||
const slug =
|
||||
'<a class="mention" href="/profile/' +
|
||||
this.comment.author.id +
|
||||
'" data-mention-id="' +
|
||||
this.comment.author.slug +
|
||||
'" target="_blank" contenteditable="false">@d' +
|
||||
this.comment.author.slug +
|
||||
'</a>'
|
||||
document.querySelector('.editor-content div').focus()
|
||||
if (document.querySelector('.is-empty')) {
|
||||
document.querySelector('.is-empty').innerHTML = '@' + this.comment.author.slug
|
||||
document.querySelector('.is-empty').innerHTML = slug + ' '
|
||||
} else {
|
||||
const html = document.querySelector('.editor-content').innerHTML
|
||||
const slug =
|
||||
'<a class="mention" href="/profile/' +
|
||||
this.comment.author.id +
|
||||
'" data-mention-id="' +
|
||||
this.comment.author.slug +
|
||||
'" target="_blank" contenteditable="false">@d' +
|
||||
this.comment.author.slug +
|
||||
'</a>'
|
||||
document.querySelector('.editor-content').innerHTML = html + '' + slug
|
||||
const html = document.querySelector('.editor-content').innerHTML
|
||||
document.querySelector('.editor-content div').innerHTML = html + ' ' + slug + ' '
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@ -269,7 +269,8 @@
|
||||
"comment": {
|
||||
"submit": "Kommentiere",
|
||||
"submitted": "Kommentar Gesendet",
|
||||
"updated": "Änderungen gespeichert"
|
||||
"updated": "Änderungen gespeichert",
|
||||
"answered": "answered"
|
||||
},
|
||||
"edited": "bearbeitet"
|
||||
},
|
||||
|
||||
@ -423,7 +423,8 @@
|
||||
"comment": {
|
||||
"submit": "Comment",
|
||||
"submitted": "Comment Submitted",
|
||||
"updated": "Changes Saved"
|
||||
"updated": "Changes Saved",
|
||||
"answered": "answered"
|
||||
},
|
||||
"edited": "edited"
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user