Rebase to master when repo went private
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
.spinner,
|
||||
.spinner-drag {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 10;
|
||||
max-width: 500px;
|
||||
}
|
||||
.spinner-background {
|
||||
background-color: rgba(255, 255, 255, 0.8);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 9;
|
||||
}
|
||||
.well {
|
||||
min-height: 20px;
|
||||
padding: 19px;
|
||||
margin-bottom: 20px;
|
||||
background-color: #f5f5f5;
|
||||
border: 1px solid #e3e3e3;
|
||||
border-radius: 4px;
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.well-lg {
|
||||
padding: 24px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<div class="spinner text-center" *ngIf="isActive" >
|
||||
<div class="well well-lg">
|
||||
<div *ngIf="isLoading&&!isConfirm" class="loader-initial"></div>
|
||||
<h5 *ngIf="!isLoading" >Drop file(s) here!</h5>
|
||||
<br />
|
||||
<span class="spinner-loading-message truncate" [innerHTML]="loadingTask ? loadingTask.status : loadingMessage"></span>
|
||||
<div *ngIf="isConfirm">
|
||||
<br><br>
|
||||
<a class="btn waves-effect waves-light red" (click)="cancel()">Cancel</a>
|
||||
<a class="btn waves-effect waves-light pink-button" (click)="confirm()">Continue</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="isActive" class="spinner-background"></div>
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LoadingSpinnerComponent } from './loading-spinner.component';
|
||||
|
||||
describe('LoadingSpinnerComponent', () => {
|
||||
let component: LoadingSpinnerComponent;
|
||||
let fixture: ComponentFixture<LoadingSpinnerComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ LoadingSpinnerComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LoadingSpinnerComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,39 @@
|
||||
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||
import { LoadingSpinnerService } from '../loading-spinner.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-loading-spinner',
|
||||
templateUrl: './loading-spinner.component.html',
|
||||
styleUrls: ['./loading-spinner.component.css'],
|
||||
})
|
||||
export class LoadingSpinnerComponent implements OnInit {
|
||||
isActive: boolean;
|
||||
isConfirm: boolean;
|
||||
isLoading: boolean;
|
||||
loadingMessage: string;
|
||||
loadingTask: any;
|
||||
confirmResolve: () => void;
|
||||
confirmReject: () => void;
|
||||
constructor(private spinnerService: LoadingSpinnerService, public changes: ChangeDetectorRef) {
|
||||
spinnerService.setSpinner(this);
|
||||
}
|
||||
ngOnInit() {}
|
||||
confirm() {
|
||||
if (this.confirmResolve) {
|
||||
this.confirmResolve();
|
||||
}
|
||||
this.isConfirm = false;
|
||||
this.confirmResolve = null;
|
||||
this.confirmReject = null;
|
||||
this.spinnerService.hideLoader();
|
||||
}
|
||||
cancel() {
|
||||
if (this.confirmReject) {
|
||||
this.confirmReject();
|
||||
}
|
||||
this.isConfirm = false;
|
||||
this.confirmResolve = null;
|
||||
this.confirmReject = null;
|
||||
this.spinnerService.hideLoader();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user