mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 05:21:52 +08:00
feat(loading): add ability to pass multiple classes to cssClass
references #7618
This commit is contained in:
@ -32,7 +32,15 @@ import { ViewController } from '../nav/view-controller';
|
|||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
})
|
})
|
||||||
export class LoadingCmp {
|
export class LoadingCmp {
|
||||||
private d: any;
|
private d: {
|
||||||
|
spinner?: string;
|
||||||
|
content?: string;
|
||||||
|
cssClass?: string;
|
||||||
|
showBackdrop?: boolean;
|
||||||
|
dismissOnPageChange?: boolean;
|
||||||
|
delay?: number;
|
||||||
|
duration?: number;
|
||||||
|
};
|
||||||
private id: number;
|
private id: number;
|
||||||
private showSpinner: boolean;
|
private showSpinner: boolean;
|
||||||
private durationTimeout: number;
|
private durationTimeout: number;
|
||||||
@ -47,7 +55,10 @@ export class LoadingCmp {
|
|||||||
this.d = params.data;
|
this.d = params.data;
|
||||||
|
|
||||||
if (this.d.cssClass) {
|
if (this.d.cssClass) {
|
||||||
renderer.setElementClass(_elementRef.nativeElement, this.d.cssClass, true);
|
this.d.cssClass.split(' ').forEach(cssClass => {
|
||||||
|
// Make sure the class isn't whitespace, otherwise it throws exceptions
|
||||||
|
if (cssClass.trim() !== '') renderer.setElementClass(_elementRef.nativeElement, cssClass, true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.id = (++loadingIds);
|
this.id = (++loadingIds);
|
||||||
|
@ -67,7 +67,7 @@ class E2EPage {
|
|||||||
presentLoadingDefault() {
|
presentLoadingDefault() {
|
||||||
let loading = this.loadingCtrl.create({
|
let loading = this.loadingCtrl.create({
|
||||||
content: 'Please wait...',
|
content: 'Please wait...',
|
||||||
cssClass: 'fixed-spinner'
|
cssClass: 'fixed-spinner spinner-class'
|
||||||
});
|
});
|
||||||
|
|
||||||
loading.present();
|
loading.present();
|
||||||
|
Reference in New Issue
Block a user