From a3090dd2d4af0de8829464874f572e1caed8e76c Mon Sep 17 00:00:00 2001 From: pliablepixels Date: Fri, 29 Jan 2016 14:17:35 -0500 Subject: #154 and #155 various updates, also ties into https://github.com/ZoneMinder/ZoneMinder/issues/1253 Former-commit-id: 7f939b4bad5d9463a7653abbdcafd79d8a6c1fa8 --- www/js/MonitorCtrl.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'www/js/MonitorCtrl.js') diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index 6d77b4fe..6b712507 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -20,6 +20,8 @@ angular.module('zmApp.controllers') $scope.monitors = []; $scope.monitors = message; + + if ($scope.monitors.length == 0) { @@ -283,7 +285,7 @@ angular.module('zmApp.controllers') console.log("**VIEW ** Monitor Ctrl Unloaded"); }); - $scope.openModal = function (mid, controllable, controlid) { + $scope.openModal = function (mid, controllable, controlid, connKey) { ZMDataModel.zmDebug("MonitorCtrl:Open Monitor Modal with monitor Id=" + mid + " and Controllable:" + controllable + " with control ID:" + controlid); @@ -293,10 +295,13 @@ angular.module('zmApp.controllers') $scope.LoginData = ZMDataModel.getLogin(); $scope.rand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111; $rootScope.rand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111; + $scope.connKey = connKey; $scope.ptzMoveCommand = ""; $scope.presetOn = false; + + // This is a modal to show the monitor footage // We need to switch to always awake if set so the feed doesn't get interrupted @@ -400,7 +405,7 @@ angular.module('zmApp.controllers') // switch off awake, as liveview is finished ZMDataModel.setAwake(false); $scope.modal.remove(); - $timeout (function() {ZMDataModel.zmLog("Stopping network pull...");window.stop();},50); + $timeout (function() {ZMDataModel.zmLog("Stopping network pull...");if (ZMDataModel.isForceNetworkStop()) window.stop();},50); }; //Cleanup the modal when we're done with it! $scope.$on('$destroy', function () { -- cgit v1.2.3