From a6f5ae260129ca3f12cab1e6a10cae46be3f910d Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 25 Feb 2020 13:17:02 -0500 Subject: [PATCH] fix cyclePlay button not working. Move SetButtonState into skin.js --- web/skins/classic/js/skin.js | 13 +++++++++++++ web/skins/classic/views/js/event.js | 12 ------------ web/skins/classic/views/js/watch.js | 6 ------ 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/web/skins/classic/js/skin.js b/web/skins/classic/js/skin.js index 2c21c0503..9e9e80764 100644 --- a/web/skins/classic/js/skin.js +++ b/web/skins/classic/js/skin.js @@ -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'); + } +} diff --git a/web/skins/classic/views/js/event.js b/web/skins/classic/views/js/event.js index f7da1341a..58a700bfb 100644 --- a/web/skins/classic/views/js/event.js +++ b/web/skins/classic/views/js/event.js @@ -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()); diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index 0ad3a5536..7fd25d603 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -1,9 +1,3 @@ -function setButtonState(element, butClass) { - if ( element ) { - element.className = butClass; - element.disabled = (butClass != 'inactive'); - } -} function showEvents() { $('ptzControls').addClass( 'hidden' );