szurubooru/client/js/util/progress.js

27 lines
349 B
JavaScript
Raw Normal View History

2020-06-04 20:09:35 +02:00
'use strict';
const nprogress = require('nprogress');
let nesting = 0;
function start() {
if (!nesting) {
nprogress.start();
}
nesting++;
}
function done() {
nesting--;
if (nesting > 0) {
nprogress.inc();
} else {
nprogress.done();
}
}
module.exports = {
start: start,
2020-06-04 20:09:35 +02:00
done: done,
};