mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
342d9a242c
no issue - allows for attributes such as class/style to be set on it's container for better display in varying situations
24 lines
623 B
JavaScript
24 lines
623 B
JavaScript
import Component from '@glimmer/component';
|
|
import {task} from 'ember-concurrency-decorators';
|
|
import {timeout} from 'ember-concurrency';
|
|
import {tracked} from '@glimmer/tracking';
|
|
|
|
export default class GhLoadingSpinnerComponent extends Component {
|
|
@tracked showSpinner = false;
|
|
|
|
// ms until the loader is displayed,
|
|
// prevents unnecessary flash of spinner
|
|
slowLoadTimeout = 200;
|
|
|
|
constructor() {
|
|
super(...arguments);
|
|
this.startSpinnerTimeout.perform();
|
|
}
|
|
|
|
@task
|
|
*startSpinnerTimeout() {
|
|
yield timeout(this.slowLoadTimeout);
|
|
this.showSpinner = true;
|
|
}
|
|
}
|