mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
1ad2c05d37
no issue - new linting rules that needed fixing: - calling `super` in lifecycle hooks - no usage of String prototype extensions
22 lines
533 B
JavaScript
22 lines
533 B
JavaScript
import Component from '@ember/component';
|
|
import {task, timeout} from 'ember-concurrency';
|
|
|
|
export default Component.extend({
|
|
tagName: '',
|
|
|
|
showSpinner: false,
|
|
// ms until the loader is displayed,
|
|
// prevents unnecessary flash of spinner
|
|
slowLoadTimeout: 200,
|
|
|
|
didInsertElement() {
|
|
this._super(...arguments);
|
|
this.startSpinnerTimeout.perform();
|
|
},
|
|
|
|
startSpinnerTimeout: task(function* () {
|
|
yield timeout(this.slowLoadTimeout);
|
|
this.set('showSpinner', true);
|
|
})
|
|
});
|