From b9f9dd721bdb5fa7757ccde74a3aff8d74ff5cbd Mon Sep 17 00:00:00 2001 From: digital-gnome <31593470+digital-gnome@users.noreply.github.com> Date: Wed, 11 Oct 2017 20:57:13 -0400 Subject: [PATCH] initialAlarmcues arguements initialAlarmcues now takes an eventId arg. Needed to reload when zms streams switch since they don't reload the page --- web/skins/classic/views/js/event.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/skins/classic/views/js/event.js b/web/skins/classic/views/js/event.js index ae57a9974..64dc9d56c 100644 --- a/web/skins/classic/views/js/event.js +++ b/web/skins/classic/views/js/event.js @@ -44,8 +44,8 @@ $j.ajaxSetup ({timeout: AJAX_TIMEOUT }); //sets timeout for all getJSON. var cueFrames = null; //make cueFrames availaible even if we don't send another ajax query -function initialAlarmCues () { - $j.getJSON("api/events/"+eventData.Id+".json", setAlarmCues); //get frames data for alarmCues and inserts into html +function initialAlarmCues (eventId) { + $j.getJSON("api/events/"+eventId+".json", setAlarmCues); //get frames data for alarmCues and inserts into html } function setAlarmCues (data) { @@ -183,6 +183,7 @@ function getCmdResponse( respObj, respText ) { var eventId = streamStatus.event; if ( eventId != lastEventId ) { eventQuery( eventId ); + initialAlarmCues(eventId); //zms uses this instead of a page reload, must call ajax+render lastEventId = eventId; } if ( streamStatus.paused == true ) { @@ -936,7 +937,7 @@ function initPage() { //FIXME prevent blocking...not sure what is happening or best way to unblock if ( $('videoobj') ) { vid = videojs("videoobj"); - initialAlarmCues(); //call ajax+renderAlarmCues after videojs is. should be only call to initialAlarmCues + initialAlarmCues(eventData.Id); //call ajax+renderAlarmCues after videojs is. should be only call to initialAlarmCues on vjs streams } if ( vid ) { /* @@ -959,7 +960,7 @@ function initPage() { } else { streamCmdTimer = streamQuery.delay( 250 ); eventQuery.pass( eventData.Id ).delay( 500 ); - initialAlarmCues(); //call ajax+renderAlarmCues for nph-zms. should be only call to initialAlarmCues + initialAlarmCues(eventData.Id); //call ajax+renderAlarmCues for nph-zms. if ( canStreamNative ) { var streamImg = $('imageFeed').getElement('img');