frontend: animate filter-bar
Massimo Melina committed
Feb 17, 2023 at 14:00 UTC
aabed28e5f1ff8ddb765290907558617dc3fb960
3 files changed
+4
-5
frontend/src/FilterBar.ts
+1
-3
@@ -11,11 +11,9 @@ export function FilterBar() {
11
12
;[state.patternFilter] = useDebounce(showFilter ? filter : '', 300)
13
14
- if (!showFilter)
15
- return null
14
const sel = Object.keys(selected).length
15
const fil = filteredList?.length
18
- return h('div', { id: 'filter-bar' },
16
+ return h('div', { id: 'filter-bar', className: showFilter ? 'show-sliding' : 'before-sliding' },
17
h(Checkbox, {
18
value: all,
19
onChange(){
frontend/src/index.scss
+1
@@ -185,6 +185,7 @@ header {
185
gap: .8em;
186
margin: 0.2em 0 0;
187
padding-left: 11px;
188
+ height: 1.8em; /* necessary to animate displaying */
189
& input[type=checkbox] { margin-top: .5em; }
190
}
191
src/apiMiddleware.ts
+2
-2
@@ -6,7 +6,7 @@ import { Readable } from 'stream'
6
import { asyncGeneratorToReadable, onOff } from './misc'
7
import events from './events'
8
import { HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_UNAUTHORIZED } from './const'
9
-import _, { DebouncedFunc } from 'lodash'
9
+import _ from 'lodash'
10
11
export class ApiError extends Error {
12
constructor(public status:number, message?:string | Error | object) {
@@ -66,7 +66,7 @@ type SendListFunc<T> = (list:SendListReadable<T>) => void
66
export class SendListReadable<T> extends Readable {
67
protected lastError: string | number | undefined
68
protected buffer: any[] = []
69
- protected processBuffer: DebouncedFunc<any>
69
+ protected processBuffer: _.DebouncedFunc<any>
70
constructor({ addAtStart, doAtStart, bufferTime }:{ bufferTime?: number, addAtStart?: T[], doAtStart?: SendListFunc<T> }={}) {
71
super({ objectMode: true, read(){} })
72
if (!bufferTime)