mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-16 21:55:37 -05:00
Enhancement: improved loading visuals (#8435)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<div class="card shadow-sm bg-light" cdkDrag [cdkDragDisabled]="!draggable" cdkDragPreviewContainer="parent">
|
||||
<div class="card shadow-sm bg-light fade" [class.reveal]="reveal" cdkDrag [cdkDragDisabled]="!draggable" cdkDragPreviewContainer="parent">
|
||||
<div class="card-header">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex">
|
||||
|
@@ -1,3 +1,12 @@
|
||||
i-bs {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.card {
|
||||
opacity: 0;
|
||||
transition: opacity .2s;
|
||||
}
|
||||
|
||||
.reveal {
|
||||
opacity: 1;
|
||||
}
|
||||
|
@@ -35,6 +35,7 @@ describe('WidgetFrameComponent', () => {
|
||||
|
||||
fixture = TestBed.createComponent(WidgetFrameComponent)
|
||||
component = fixture.componentInstance
|
||||
jest.useFakeTimers()
|
||||
|
||||
fixture.detectChanges()
|
||||
})
|
||||
@@ -51,4 +52,10 @@ describe('WidgetFrameComponent', () => {
|
||||
fixture.detectChanges()
|
||||
expect(fixture.debugElement.query(By.css('.spinner-border'))).not.toBeNull()
|
||||
})
|
||||
|
||||
it('should reveal', () => {
|
||||
expect(component.reveal).toBeFalsy()
|
||||
jest.advanceTimersByTime(100)
|
||||
expect(component.reveal).toBeTruthy()
|
||||
})
|
||||
})
|
||||
|
@@ -1,11 +1,11 @@
|
||||
import { Component, Input } from '@angular/core'
|
||||
import { AfterViewInit, Component, Input } from '@angular/core'
|
||||
|
||||
@Component({
|
||||
selector: 'pngx-widget-frame',
|
||||
templateUrl: './widget-frame.component.html',
|
||||
styleUrls: ['./widget-frame.component.scss'],
|
||||
})
|
||||
export class WidgetFrameComponent {
|
||||
export class WidgetFrameComponent implements AfterViewInit {
|
||||
constructor() {}
|
||||
|
||||
@Input()
|
||||
@@ -16,4 +16,12 @@ export class WidgetFrameComponent {
|
||||
|
||||
@Input()
|
||||
draggable: any
|
||||
|
||||
public reveal: boolean = false
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
setTimeout(() => {
|
||||
this.reveal = true
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user