Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add primary attribute for current user #2878

Merged
merged 3 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/editor-rich.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor-rich.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/files-modal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/files-modal.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions js/text-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-files.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-text.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-text.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-viewer.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ export default {
return true
},

/** @param {Event} event */
/** @param {Event} event The passed event */
preparePrinting(event) {
const content = document.getElementById('content')
// Hide Content behind modal, this also hides the sidebar if open
Expand Down
11 changes: 10 additions & 1 deletion src/extensions/Mention.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<NodeViewWrapper as="span" class="mention" contenteditable="false">
<NcUserBubble :user="node.attrs.id" :display-name="username" class="mention-user-bubble">
<NcUserBubble :user="node.attrs.id"
:display-name="username"
:primary="isCurrentUser"
class="mention-user-bubble">
@{{ username }}
</NcUserBubble>
</NodeViewWrapper>
Expand All @@ -9,6 +12,7 @@
<script>
import NcUserBubble from '@nextcloud/vue/dist/Components/NcUserBubble.js'
import { NodeViewWrapper } from '@tiptap/vue-2'
import { getCurrentUser } from '@nextcloud/auth'

export default {
name: 'Mention',
Expand All @@ -32,6 +36,11 @@ export default {
username: this.node.attrs.label,
}
},
computed: {
isCurrentUser() {
return this.node.attrs.id === getCurrentUser().uid
},
},
}
</script>
<style scoped>
Expand Down