update setButtonState

This commit is contained in:
Andrew Bauer 2020-12-23 12:20:31 -06:00
parent f64f3262ed
commit a94550795b
1 changed files with 4 additions and 4 deletions

View File

@ -599,11 +599,11 @@ function scaleToFit(baseWidth, baseHeight, scaleEl, bottomEl) {
return {width: Math.floor(newWidth), height: Math.floor(newHeight), autoScale: autoScale};
}
function setButtonState(element_id, butClass) {
var element = $(element_id);
function setButtonState(element_id, btnClass) {
var element = document.getElementById(element_id);
if ( element ) {
element.className = butClass;
if (butClass == 'unavail' || (butClass == 'active' && (element.id == 'pauseBtn' || element.id == 'playBtn'))) {
element.className = btnClass;
if (btnClass == 'unavail' || (btnClass == 'active' && (element.id == 'pauseBtn' || element.id == 'playBtn'))) {
element.disabled = true;
} else {
element.disabled = false;