Bug fixes
This commit is contained in:
parent
f5bebc4c13
commit
855bca9e4d
11
main_UI.js
11
main_UI.js
@ -721,7 +721,7 @@ function showChildElement(id, index, options = {}) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
function buttonLoader(id, show) {
|
function buttonLoader(id, show) {
|
||||||
const button = typeof id === 'string' ? getRef(id) : id;
|
const button = typeof id === 'string' ? document.getElementById(id) : id;
|
||||||
button.disabled = show;
|
button.disabled = show;
|
||||||
const animOptions = {
|
const animOptions = {
|
||||||
duration: 200,
|
duration: 200,
|
||||||
@ -729,6 +729,7 @@ function buttonLoader(id, show) {
|
|||||||
easing: 'ease'
|
easing: 'ease'
|
||||||
}
|
}
|
||||||
if (show) {
|
if (show) {
|
||||||
|
button.parentNode.append(createElement('sm-spinner'))
|
||||||
button.animate([
|
button.animate([
|
||||||
{
|
{
|
||||||
clipPath: 'circle(100%)',
|
clipPath: 'circle(100%)',
|
||||||
@ -736,13 +737,9 @@ function buttonLoader(id, show) {
|
|||||||
{
|
{
|
||||||
clipPath: 'circle(0)',
|
clipPath: 'circle(0)',
|
||||||
},
|
},
|
||||||
], animOptions).onfinish = e => {
|
], animOptions)
|
||||||
e.target.commitStyles()
|
|
||||||
e.target.cancel()
|
|
||||||
}
|
|
||||||
button.parentNode.append(createElement('sm-spinner'))
|
|
||||||
} else {
|
} else {
|
||||||
button.style = ''
|
button.getAnimations().forEach(anim => anim.cancel())
|
||||||
const potentialTarget = button.parentNode.querySelector('sm-spinner')
|
const potentialTarget = button.parentNode.querySelector('sm-spinner')
|
||||||
if (potentialTarget) potentialTarget.remove();
|
if (potentialTarget) potentialTarget.remove();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user