Former-commit-id: 3379de3702aeb69c83fbeb45df683fc30ea291e3 [formerly 82957c19e2e6fef91c73a74e49e485b4c9463689] [formerly 1020925f8e6f073244fa9b37466920676cf209af [formerly 55c097b2aa0b6cabfa953202588d8196a0d21538]] Former-commit-id: e883c22efcc7f56061676319df571bc99370080a [formerly 71276f1d4aa5ddefdfc0411a4dbb656d459e317a] Former-commit-id: 7f93307b5a56493a2eff07e62185b110012b2293
40 lines
766 B
JavaScript
40 lines
766 B
JavaScript
function loading (button) {
|
|
let el = document.querySelector(`#${button}-button > i`)
|
|
|
|
if (el === undefined || el === null) {
|
|
console.log('Error getting button ' + button)
|
|
return
|
|
}
|
|
|
|
el.dataset.icon = el.innerHTML
|
|
el.style.opacity = 0
|
|
|
|
setTimeout(() => {
|
|
el.classList.add('spin')
|
|
el.innerHTML = 'autorenew'
|
|
el.style.opacity = 1
|
|
}, 100)
|
|
}
|
|
|
|
function done (button, success = true) {
|
|
let el = document.querySelector(`#${button}-button > i`)
|
|
|
|
if (el === undefined || el === null) {
|
|
console.log('Error getting button ' + button)
|
|
return
|
|
}
|
|
|
|
el.style.opacity = 0
|
|
|
|
setTimeout(() => {
|
|
el.classList.remove('spin')
|
|
el.innerHTML = el.dataset.icon
|
|
el.style.opacity = 1
|
|
}, 100)
|
|
}
|
|
|
|
export default {
|
|
loading,
|
|
done
|
|
}
|