mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 01:42:29 +03:00
25 lines
580 B
JavaScript
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;
|