Handle a zero value for scale

This commit is contained in:
Isaac Connor 2020-02-25 11:18:13 -05:00
parent 2f89bd28b7
commit 8a83449fba
1 changed files with 6 additions and 6 deletions

View File

@ -160,7 +160,7 @@ function changeScale() {
} 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;
@ -175,7 +175,7 @@ function changeScale() {
} // 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