1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/mixins/loading-indicator.js
Maurice Williams 385afefb46 Re-implementing the loading indicator for the Ember admin
closes #2855 , closes #2848
- New  mixin that utilizes NProgress for displaying a loading indictor for all routes who's model issue a "loading" event (aka: when requesting data from the server during a route change).
- Also removing (the now unnecessary) "loading" template.
2014-06-23 10:01:33 -04:00

25 lines
580 B
JavaScript

// mixin used for routes to display a loading indicator when there is network activity
var loaderOptions = {
'showSpinner': false
};
NProgress.configure(loaderOptions);
var loadingIndicator = Ember.Mixin.create({
actions: {
loading: function () {
NProgress.start();
this.router.one('didTransition', function () {
NProgress.done();
});
return true;
},
error: function () {
NProgress.done();
return true;
}
}
});
export default loadingIndicator;