forked from FoundKeyGang/FoundKey
✌️
This commit is contained in:
parent
f6f1eb1bca
commit
4dc96b87dd
2 changed files with 21 additions and 16 deletions
21
src/web/app/common/scripts/loading.js
Normal file
21
src/web/app/common/scripts/loading.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
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);
|
||||
}
|
||||
};
|
|
@ -1,16 +0,0 @@
|
|||
NProgress = require \nprogress
|
||||
NProgress.configure do
|
||||
trickle-speed: 500ms
|
||||
show-spinner: false
|
||||
|
||||
root = document.get-elements-by-tag-name \html .0
|
||||
|
||||
module.exports =
|
||||
start: ~>
|
||||
root.class-list.add \progress
|
||||
NProgress.start!
|
||||
done: ~>
|
||||
root.class-list.remove \progress
|
||||
NProgress.done!
|
||||
set: (val) ~>
|
||||
NProgress.set val
|
Loading…
Reference in a new issue