misskey/src/web/app/common/scripts/loading.js

22 lines
376 B
JavaScript
Raw Normal View History

2017-02-18 08:53:46 +01:00
const NProgress = require('nprogress');
NProgress.configure({
trickleSpeed: 500,
showSpinner: false
});
const root = document.getElementsByTagName('html')[0];
module.exports = {
start: () => {
root.classList.add('progress');
NProgress.start();
},
done: () => {
root.classList.remove('progress');
NProgress.done();
},
set: val => {
NProgress.set(val);
}
};