You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
rename _assets to assets
This commit is contained in:
39
assets/src/utils/buttons.js
Normal file
39
assets/src/utils/buttons.js
Normal file
@@ -0,0 +1,39 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user