mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 02:41:50 +03:00
99dd49903d
no issue - add loading substates for all routes that previously blocked transitions until their model had finished loading - enables immediate response on navigation click - loading templates include the title bar to provide immediate indication of which page is loading - loading templates include a new `{{gh-loading-spinner}}` component that will only show the spinner after 200ms to avoid flashing a spinner for users on fast connections - updated Version Mismatch tests to match new behaviour of intermediate transitions when navigating
21 lines
511 B
JavaScript
21 lines
511 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,
|
|
|
|
startSpinnerTimeout: task(function* () {
|
|
yield timeout(this.get('slowLoadTimeout'));
|
|
this.set('showSpinner', true);
|
|
}),
|
|
|
|
didInsertElement() {
|
|
this.get('startSpinnerTimeout').perform();
|
|
}
|
|
});
|