diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-11-07 11:46:00 -0500 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-11-07 11:46:00 -0500 |
| commit | e5c31879213c3038abcf7fe1d84fef28dd5bf6ba (patch) | |
| tree | 30e4ebd7a7a759bbbd7ea281c00ff9f580b86acc /www | |
| parent | d8b0c15aaf7fbaca2442c9312e65da8ecae2c8dd (diff) | |
process push in monitors after we load the array
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/MonitorCtrl.js | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index 7fc2cec2..7241db53 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -293,15 +293,21 @@ angular.module('zmApp.controllers') var tm = $rootScope.tappedMid; $rootScope.tappedMid = 0; var monitem; - for (var m = 0; m < $scope.monitors.length; m++) { - if ($scope.monitors[m].Monitor.Id == tm) { - monitem = $scope.monitors[m]; - break; - } - } + NVRDataModel.getMonitors(0) + .then ( function (data) { + $scope.monitors = data; + for (var m = 0; m < $scope.monitors.length; m++) { + if ($scope.monitors[m].Monitor.Id == tm) { + monitem = $scope.monitors[m]; + break; + } + } + openModal(monitem.Monitor.Id, monitem.Monitor.Controllable, monitem.Monitor.ControlId, monitem.Monitor.connKey, monitem); + }); + - openModal(monitem.Monitor.Id, monitem.Monitor.Controllable, monitem.Monitor.ControlId, monitem.Monitor.connKey, monitem); + } }); |
