mirror of
https://github.com/gtsteffaniak/filebrowser.git
synced 2026-11-26 08:29:41 -05:00
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Kevin B. <kurami32_kbm@proton.me>
68 lines
1.1 KiB
JavaScript
68 lines
1.1 KiB
JavaScript
function loading(button) {
|
|
const el = document.querySelector(`#${button}-button > i`);
|
|
|
|
if (el === null) {
|
|
return;
|
|
}
|
|
|
|
if (el.innerHTML === "autorenew" || el.innerHTML === "done") {
|
|
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) {
|
|
const el = document.querySelector(`#${button}-button > i`);
|
|
|
|
if (el === null) {
|
|
return;
|
|
}
|
|
|
|
el.style.opacity = 0;
|
|
|
|
setTimeout(() => {
|
|
el.classList.remove("spin");
|
|
el.innerHTML = el.dataset.icon;
|
|
el.style.opacity = 1;
|
|
}, 100);
|
|
}
|
|
|
|
function success(button) {
|
|
const el = document.querySelector(`#${button}-button > i`);
|
|
|
|
if (el === null) {
|
|
return;
|
|
}
|
|
|
|
el.style.opacity = 0;
|
|
|
|
setTimeout(() => {
|
|
el.classList.remove("spin");
|
|
el.innerHTML = "done";
|
|
el.style.opacity = 1;
|
|
|
|
setTimeout(() => {
|
|
el.style.opacity = 0;
|
|
|
|
setTimeout(() => {
|
|
el.innerHTML = el.dataset.icon;
|
|
el.style.opacity = 1;
|
|
}, 100);
|
|
}, 500);
|
|
}, 100);
|
|
}
|
|
|
|
export default {
|
|
loading,
|
|
done,
|
|
success,
|
|
};
|