mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
first example dynamisch usermention for answer comments
This commit is contained in:
parent
57a4309b30
commit
490fb7fdeb
@ -55,6 +55,13 @@
|
||||
</div>
|
||||
<ds-space margin-bottom="small" />
|
||||
</ds-card>
|
||||
<ds-button
|
||||
v-bind:title="antworten"
|
||||
icon="level-down"
|
||||
style="float:right; top: -22px;"
|
||||
@click.prevent="answerComment"
|
||||
></ds-button>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -168,6 +175,22 @@ export default {
|
||||
this.$toast.error(err.message)
|
||||
}
|
||||
},
|
||||
answerComment() {
|
||||
if (document.querySelector('.is-empty')) {
|
||||
document.querySelector('.is-empty').innerHTML = '@' + this.comment.author.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
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user