From 8a83449fbaca195a16e79f8028a1b6fdae45f4ca Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 25 Feb 2020 11:18:13 -0500 Subject: [PATCH] Handle a zero value for scale --- web/skins/classic/views/js/event.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/skins/classic/views/js/event.js b/web/skins/classic/views/js/event.js index f7da1341a..5de12091c 100644 --- a/web/skins/classic/views/js/event.js +++ b/web/skins/classic/views/js/event.js @@ -155,12 +155,12 @@ function changeScale() { var eventViewer; var alarmCue = $j('div.alarmCue'); var bottomEl = streamMode == 'stills' ? $j('#eventImageNav') : $j('#replayStatus'); - if (streamMode == 'stills') { + if ( streamMode == 'stills' ) { eventViewer = $j('#eventThumbs'); } else { eventViewer = $j(vid ? '#videoobj' : '#evtStream'); } - if ( scale == "auto" ) { + if ( scale == '0' ) { var newSize = scaleToFit(eventData.Width, eventData.Height, eventViewer, bottomEl); newWidth = newSize.width; newHeight = newSize.height; @@ -172,10 +172,10 @@ function changeScale() { } if ( !(streamMode == 'stills') ) { eventViewer.width(newWidth); - } //stills handles its own width + } // stills handles its own width eventViewer.height(newHeight); if ( !vid ) { // zms needs extra sizing - streamScale(scale == "auto" ? autoScale : scale); + streamScale(scale == '0' ? autoScale : scale); drawProgressBar(); } if ( streamMode == 'stills' ) { @@ -184,7 +184,7 @@ function changeScale() { } else { alarmCue.html(renderAlarmCues(eventViewer));//just re-render alarmCues. skip ajax call } - if ( scale == "auto" ) { + if ( scale == '0' ) { Cookie.write('zmEventScaleAuto', 'auto', {duration: 10*365}); } else { Cookie.write('zmEventScale'+eventData.MonitorId, scale, {duration: 10*365}); @@ -1091,7 +1091,7 @@ function initPage() { } nearEventsQuery(eventData.Id); initialAlarmCues(eventData.Id); //call ajax+renderAlarmCues - if ( scale == 'auto' ) changeScale(); + if ( scale == '0' ) changeScale(); } // Kick everything off