mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
0e9d4e6792
Refs #4001 - grunt-jscs@0.8.1 which provides ES6 support.
32 lines
616 B
JavaScript
32 lines
616 B
JavaScript
// mixin used for routes to display a loading indicator when there is network activity
|
|
var loaderOptions,
|
|
loadingIndicator;
|
|
|
|
loaderOptions = {
|
|
showSpinner: false
|
|
};
|
|
|
|
NProgress.configure(loaderOptions);
|
|
|
|
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;
|