Skip to content

Commit 06fcf14

Browse files
susnuxmax-nextcloud
authored andcommitted
Replace "Saved" indicator with an icon
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
1 parent 4fa523a commit 06fcf14

File tree

1 file changed

+22
-45
lines changed

1 file changed

+22
-45
lines changed

src/components/Editor/Status.vue

Lines changed: 22 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@
2222

2323
<template>
2424
<div class="text-editor__session-list">
25-
<div v-if="$isMobile" v-tooltip="lastSavedStatusTooltip" :class="saveStatusClass" />
26-
<div v-else
27-
v-tooltip="lastSavedStatusTooltip"
28-
class="save-status"
29-
:aria-label="t('text', 'Document save status')"
30-
:class="lastSavedStatusClass">
31-
{{ lastSavedStatus }}
25+
<div v-tooltip="lastSavedStatusTooltip" class="save-status" :class="saveStatusClass">
26+
<CheckIcon v-if="saveStatusClass === 'saved'" />
27+
<Loading v-else-if="saveStatusClass === 'saving'" />
28+
<WarnIcon v-else />
3229
</div>
3330
<SessionList :sessions="sessions">
3431
<p slot="lastSaved" class="last-saved">
@@ -42,6 +39,7 @@
4239
<script>
4340
4441
import { ERROR_TYPE } from './../../services/SyncService.js'
42+
import { Check as CheckIcon, Loading, Warn as WarnIcon } from '../icons.js'
4543
import { Tooltip } from '@nextcloud/vue'
4644
import {
4745
useIsMobileMixin,
@@ -52,6 +50,9 @@ export default {
5250
name: 'Status',
5351
5452
components: {
53+
CheckIcon,
54+
Loading,
55+
WarnIcon,
5556
SessionList: () => import(/* webpackChunkName: "editor-collab" */'./SessionList.vue'),
5657
GuestNameDialog: () => import(/* webpackChunkName: "editor-guest" */'./GuestNameDialog.vue'),
5758
},
@@ -100,9 +101,6 @@ export default {
100101
}
101102
return this.dirtyStateIndicator ? t('text', 'Saving …') : t('text', 'Saved')
102103
},
103-
lastSavedStatusClass() {
104-
return this.syncError && this.lastSavedString !== '' ? 'error' : ''
105-
},
106104
dirtyStateIndicator() {
107105
return this.dirty || this.hasUnsavedChanges
108106
},
@@ -125,9 +123,9 @@ export default {
125123
},
126124
saveStatusClass() {
127125
if (this.syncError && this.lastSavedString !== '') {
128-
return 'save-error'
126+
return 'error'
129127
}
130-
return this.dirtyStateIndicator ? 'saving-status' : 'saved-status'
128+
return this.dirtyStateIndicator ? 'saving' : 'saved'
131129
},
132130
currentSession() {
133131
return Object.values(this.sessions).find((session) => session.isCurrent)
@@ -148,45 +146,24 @@ export default {
148146
}
149147
150148
.save-status {
149+
background-color: var(--color-background-dark);
150+
border-radius: 50%;
151+
color: var(--color-text-lighter);
151152
display: inline-flex;
153+
justify-content: center;
152154
padding: 0;
153-
text-overflow: ellipsis;
154-
color: var(--color-text-lighter);
155-
position: relative;
156-
top: 9px;
157-
min-width: 85px;
158-
max-height: 36px;
155+
height: 40px;
156+
width: 40px;
159157
160158
&.error {
161-
background-color: var(--color-error);
162-
color: var(--color-main-background);
163-
border-radius: 3px;
159+
border: 2px solid var(--color-error);
160+
width: 36px;
161+
height: 36px;
164162
}
165-
}
166-
</style>
167-
168-
<style lang="scss">
169-
.saved-status,.saving-status {
170-
display: inline-flex;
171-
padding: 0;
172-
text-overflow: ellipsis;
173-
color: var(--color-text-lighter);
174-
background-color: var(--color-main-background);
175-
width: 38px !important;
176-
height: 38px !important;
177-
z-index: 2;
178-
}
179-
180-
.saved-status {
181-
border: 2px solid #04AA6D;
182-
border-radius: 50%;
183-
}
184163
185-
.saving-status {
186-
border: 2px solid #f3f3f3;
187-
border-top: 2px solid #3498db;
188-
border-radius: 50%;
189-
animation: spin 2s linear infinite;
164+
&.saved {
165+
color: var(--color-success)
166+
}
190167
}
191168
192169
.last-saved {

0 commit comments

Comments
 (0)