You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
Former-commit-id: 3f427b6f34b0a9498c883a15fce396c14640f8f0 [formerly 514a1adf5ff43ba73bb9b13c59d4089b3a72c639] [formerly f0ebafb4fc9b6067ec6c95c881b2652dd2df00f8 [formerly 973d4380df]]
Former-commit-id: 02698fd8f45ce1b5c8d9b3b21bc85ccd42e63b11 [formerly 5eb200cf02ae14d57e14e024ee798fe5dad87a3c]
Former-commit-id: 835d7ed9789dc51311f0c943f3f8f7f01398e26d
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
|
|
}, 200)
|
|
}
|
|
|
|
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
|
|
}, 200)
|
|
}
|
|
|
|
export default {
|
|
loading,
|
|
done
|
|
}
|