Files
filebrowser/_assets/src/utils/buttons.js
Henrique Dias 4401a128ce Fix Upload and remove last part of button animation.
Former-commit-id: 3f427b6f34b0a9498c883a15fce396c14640f8f0 [formerly 514a1adf5ff43ba73bb9b13c59d4089b3a72c639] [formerly f0ebafb4fc9b6067ec6c95c881b2652dd2df00f8 [formerly 973d4380df]]
Former-commit-id: 02698fd8f45ce1b5c8d9b3b21bc85ccd42e63b11 [formerly 5eb200cf02ae14d57e14e024ee798fe5dad87a3c]
Former-commit-id: 835d7ed9789dc51311f0c943f3f8f7f01398e26d
2017-07-04 18:08:42 +01:00

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
}