accounts-frontend/src/services/loader.js

17 lines
380 B
JavaScript
Raw Normal View History

// On page initialization loader is already visible, so initial value is 1
let stack = 1;
export default {
show() {
if (++stack !== 1) {
document.getElementById('loader').classList.add('is-active');
}
},
hide() {
if (--stack === 0) {
document.getElementById('loader').classList.remove('is-active');
}
}
};