fix: faulty upload button animation
Massimo Melina committed
May 7, 2025 at 19:44 UTC
8864f930b6cd1a6aa23e4b03cb2f6e32455e0f2f
3 files changed
+7
-14
frontend/src/index.scss
+5
-12
@@ -121,7 +121,6 @@ button {
121
color: var(--button-text);
122
padding: .4em .6em;
123
display: inline-flex; align-items: center; justify-content: center; // get closer results between chrome and safari
124
- &:not(.before-sliding) { min-width: min-content; }
124
&.small { padding: 0 0.4em; height: 30px; }
125
.icon { margin: -.2em 0; }
126
.font-icon { vertical-align: middle; }
@@ -208,20 +207,14 @@ kbd {
207
box-shadow: 0 0 .3em .3em var(--warning);
208
}
209
211
-.before-sliding {
212
- width: 0 !important;
213
- flex: 0 !important;
214
- margin: 0 !important;
215
- height: 0 !important;
216
- padding: 0 !important;
210
+.sliding {
211
+ transition: flex .5s, flex-basis 0.5s ease, opacity 0.5s ease;
212
overflow: hidden !important;
218
- transition: flex .5s;
213
}
220
-.show-sliding {
221
- transition: flex .5s;
222
- overflow: clip;
223
- flex: 1;
214
+.hide-sliding {
215
white-space: nowrap;
216
+ margin: 0 !important;
217
+ flex: 0 !important;
218
}
219
220
.ani-working { animation:2s blink infinite }
frontend/src/menu.ts
+1
-1
@@ -77,7 +77,7 @@ export function MenuPanel() {
77
label: t`Upload`,
78
disabled: !changingButton,
79
tabIndex: changingButton ? undefined : -1,
80
- className: changingButton ? 'show-sliding ' + (uploading && !uploadDialogIsOpen ? 'ani-working' : '') : 'before-sliding',
80
+ className: 'sliding ' + (changingButton ? '' : 'hide-sliding') + (uploading && !uploadDialogIsOpen ? ' ani-working' : ''),
81
onClick: showUpload,
82
}),
83
h(Btn, showFilter && can_delete ? {
src/vfs.ts
+1
-1
@@ -4,7 +4,7 @@ import fs from 'fs/promises'
4
import { basename, dirname, join, resolve } from 'path'
5
import {
6
makeMatcher, setHidden, onlyTruthy, isValidFileName, throw_, VfsPerms, Who,
7
- isWhoObject, WHO_ANY_ACCOUNT, defaultPerms, PERM_KEYS, removeStarting, HTTP_SERVER_ERROR, try_, matches, with_
7
+ isWhoObject, WHO_ANY_ACCOUNT, defaultPerms, PERM_KEYS, removeStarting, HTTP_SERVER_ERROR, try_, matches,
8
} from './misc'
9
import Koa from 'koa'
10
import _ from 'lodash'