mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
fix(loading): set default spinner on loading
This commit is contained in:
@ -19,6 +19,7 @@ import iOSLeaveAnimation from './animations/ios.leave';
|
|||||||
export class Loading {
|
export class Loading {
|
||||||
private animation: Animation;
|
private animation: Animation;
|
||||||
private durationTimeout: any;
|
private durationTimeout: any;
|
||||||
|
private mode: string;
|
||||||
|
|
||||||
@Element() private el: HTMLElement;
|
@Element() private el: HTMLElement;
|
||||||
|
|
||||||
@ -132,7 +133,15 @@ export class Loading {
|
|||||||
|
|
||||||
protected ionViewDidLoad() {
|
protected ionViewDidLoad() {
|
||||||
if (!this.spinner) {
|
if (!this.spinner) {
|
||||||
this.spinner = this.config.get('loadingSpinner', this.config.get('spinner', 'lines'));
|
let defaultSpinner = 'lines';
|
||||||
|
|
||||||
|
if (this.mode === 'md') {
|
||||||
|
defaultSpinner = 'crescent';
|
||||||
|
} else if (this.mode === 'wp') {
|
||||||
|
defaultSpinner = 'circles';
|
||||||
|
}
|
||||||
|
|
||||||
|
this.spinner = this.config.get('loadingSpinner') || defaultSpinner;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.showSpinner === null || this.showSpinner === undefined) {
|
if (this.showSpinner === null || this.showSpinner === undefined) {
|
||||||
|
Reference in New Issue
Block a user