From 855bca9e4da7890f71869fe3461269c1b3801d6f Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Thu, 13 Apr 2023 00:32:10 +0530 Subject: [PATCH] Bug fixes --- main_UI.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/main_UI.js b/main_UI.js index 21572e8..92cd018 100644 --- a/main_UI.js +++ b/main_UI.js @@ -721,7 +721,7 @@ function showChildElement(id, index, options = {}) { }) } function buttonLoader(id, show) { - const button = typeof id === 'string' ? getRef(id) : id; + const button = typeof id === 'string' ? document.getElementById(id) : id; button.disabled = show; const animOptions = { duration: 200, @@ -729,6 +729,7 @@ function buttonLoader(id, show) { easing: 'ease' } if (show) { + button.parentNode.append(createElement('sm-spinner')) button.animate([ { clipPath: 'circle(100%)', @@ -736,13 +737,9 @@ function buttonLoader(id, show) { { clipPath: 'circle(0)', }, - ], animOptions).onfinish = e => { - e.target.commitStyles() - e.target.cancel() - } - button.parentNode.append(createElement('sm-spinner')) + ], animOptions) } else { - button.style = '' + button.getAnimations().forEach(anim => anim.cancel()) const potentialTarget = button.parentNode.querySelector('sm-spinner') if (potentialTarget) potentialTarget.remove(); }