diff options
author | Luka Trovic <luka@nextcloud.com> | 2022-08-23 20:17:27 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-08-25 12:04:53 +0300 |
commit | e15dc93ec5964c030144dc7b33f48bd8932a9571 (patch) | |
tree | 8fc322de31d982985e509e2b678ade4788527ca5 /src/extensions | |
parent | b7f3f3927b2c7d8a1d1e5693695fe22d93bafcc3 (diff) |
feat: display correct username and use ISearch to search users
Signed-off-by: Luka Trovic <luka@nextcloud.com>
Diffstat (limited to 'src/extensions')
-rw-r--r-- | src/extensions/Mention.js | 2 | ||||
-rw-r--r-- | src/extensions/Mention.vue | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/extensions/Mention.js b/src/extensions/Mention.js index 6f548ef20..408dd6300 100644 --- a/src/extensions/Mention.js +++ b/src/extensions/Mention.js @@ -21,7 +21,7 @@ export default TipTapMention.extend({ toMarkdown(state, node) { state.write(' ') - state.write(`@[${node.attrs.id}](mention://user/${node.attrs.id})`) + state.write(`@[${node.attrs.id}](mention://user/${node.attrs.label})`) state.write(' ') }, }) diff --git a/src/extensions/Mention.vue b/src/extensions/Mention.vue index 73b1c6b8e..f6dc57727 100644 --- a/src/extensions/Mention.vue +++ b/src/extensions/Mention.vue @@ -1,7 +1,7 @@ <template> <NodeViewWrapper as="span" class="mention" contenteditable="false"> - <UserBubble :user="node.attrs.id" :display-name="node.attrs.id.trim()"> - @{{ node.attrs.id.trim() }} + <UserBubble :user="node.attrs.id" :display-name="username" class="mention-user-bubble"> + @{{ username }} </UserBubble> </NodeViewWrapper> </template> @@ -27,6 +27,11 @@ export default { required: true, }, }, + data() { + return { + username: this.node.attrs.label + } + } } </script> <style scoped> @@ -34,4 +39,11 @@ export default { .text-editor__wrapper div.ProseMirror .mention[contenteditable=false] :deep(*) { -webkit-user-modify: read-only !important; } + +.mention-user-bubble /deep/ .user-bubble__content .user-bubble__title { + position: relative !important; + top: -20px !important; + left: -60px !important; + height: 40px; +} </style> |