fix cyclePlay button not working. Move SetButtonState into skin.js

pull/2926/head
Isaac Connor 2020-02-25 13:17:02 -05:00
parent ced36a5333
commit a6f5ae2601
3 changed files with 13 additions and 18 deletions

View File

@ -557,3 +557,16 @@ function scaleToFit(baseWidth, baseHeight, scaleEl, bottomEl) {
autoScale = closest;
return {width: Math.floor(newWidth), height: Math.floor(newHeight), autoScale: autoScale};
}
function setButtonState(element, butClass) {
if ( element ) {
element.className = butClass;
if (butClass == 'unavail' || (butClass == 'active' && (element.id == 'pauseBtn' || element.id == 'playBtn'))) {
element.disabled = true;
} else {
element.disabled = false;
}
} else {
console.log('Element was null in setButtonState');
}
}

View File

@ -130,18 +130,6 @@ function renderAlarmCues(containerEl) {
return alarmHtml;
}
function setButtonState( element, butClass ) {
if ( element ) {
element.className = butClass;
if (butClass == 'unavail' || (butClass == 'active' && (element.id == 'pauseBtn' || element.id == 'playBtn'))) {
element.disabled = true;
} else {
element.disabled = false;
}
} else {
console.log('Element was null in setButtonState');
}
}
function changeCodec() {
location.replace(thisUrl + '?view=event&eid=' + eventData.Id + filterQuery + sortQuery+'&codec='+$j('#codec').val());

View File

@ -1,9 +1,3 @@
function setButtonState(element, butClass) {
if ( element ) {
element.className = butClass;
element.disabled = (butClass != 'inactive');
}
}
function showEvents() {
$('ptzControls').addClass( 'hidden' );