Skip to content
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-collab.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/editor-guest.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/editor-guest.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/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.

3 changes: 2 additions & 1 deletion src/components/GuestNameDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export default {
<style scoped lang="scss">
form.guest-name-dialog {
display: flex;
align-items: center;
padding: 6px;

&::v-deep img {
Expand All @@ -102,7 +103,7 @@ export default {
flex-grow: 1;
}
label {
padding: 3px;
padding-right: 3px;
height: 32px;
}
}
Expand Down
42 changes: 17 additions & 25 deletions src/components/SessionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<template>
<Popover class="session-list" placement="top">
<button slot="trigger"
v-tooltip.bottom="editorsTooltip"
v-tooltip.bottom="t('text', 'Participants')"
class="avatar-list">
<div class="avatardiv icon-group" />
<div v-for="session in sessionsVisible"
Expand All @@ -43,7 +43,7 @@
<div class="session-menu">
<ul>
<slot />
<li v-for="session in sessionPopoverList"
<li v-for="session in participantsPopover"
:key="session.id"
:style="avatarStyle(session)">
<div class="avatar-wrapper"
Expand All @@ -53,7 +53,7 @@
:disable-menu="true"
:show-user-status="false"
:disable-tooltip="true"
:size="44" />
:size="32" />
</div>
{{ session.guestName ? session.guestName : session.displayName }}
</li>
Expand Down Expand Up @@ -110,18 +110,18 @@ export default {
this.$store.dispatch('setShowAuthorAnnotations', value)
},
},
editorsTooltip() {
const tooltipPrefix = t('text', 'Currently active users:') + ' '
if (this.sessionPopoverList.length > 0) {
const first = this.activeSessions.slice(0, 3).map((session) => session.guestName ? session.guestName : session.displayName).join(', ')
const others = this.activeSessions.slice(3).length
return tooltipPrefix + first + ' ' + n('text', 'and %n other editor', 'and %n other editors', others)
participantsPopover() {
if (this.currentSession.guestName) {
return this.participantsWithoutCurrent
}
return tooltipPrefix + this.activeSessions.slice(0, 3).map((session) => session.guestName ? session.guestName : session.displayName).join(', ')
return this.participants
},
activeSessions() {
participantsWithoutCurrent() {
return this.participants.filter((session) => !session.isCurrent)
},
participants() {
return Object.values(this.sessions).filter((session) =>
session.lastContact > Date.now() / 1000 - COLLABORATOR_DISCONNECT_TIME && !session.isCurrent
session.lastContact > Date.now() / 1000 - COLLABORATOR_DISCONNECT_TIME
&& (session.userId !== null || session.guestName !== null)
).sort((a, b) => a.lastContact < b.lastContact)
},
Expand All @@ -144,22 +144,13 @@ export default {
}
},
sessionsVisible() {
return this.activeSessions.slice(0, 3)
},
sessionPopoverList() {
return this.activeSessions.slice(3)
return this.participantsWithoutCurrent.slice(0, 3)
},
},
}
</script>

<style scoped lang="scss">
.avatardiv {
width: 44px !important;
height: 44px !important;
line-height: 44px;
}

.avatar-list {
border: none;
background-color: var(--color-main-background);
Expand All @@ -175,7 +166,8 @@ export default {

.avatar-wrapper {
margin: 0 -8px 0 0;
margin-left: 0;
height: 44px;
width: 44px;
}

.icon-more, .icon-group, .icon-settings-dark {
Expand All @@ -187,8 +179,6 @@ export default {
}

.avatar-wrapper {
width: 44px;
height: 44px;
z-index: 1;
border-radius: 50%;
overflow: hidden;
Expand All @@ -206,6 +196,8 @@ export default {
padding: 6px;

.avatar-wrapper {
height: 32px;
width: 32px;
margin-right: 6px;
}
}
Expand Down