diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-12-09 14:03:39 -0500 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-12-09 14:03:39 -0500 |
| commit | c38549b7348e6808bcb93d6d7a23ecd91ffa7a2e (patch) | |
| tree | 2dc4d84c3a5dceebd568c6cc8e91a5099355cdc8 /www/js/MontageCtrl.js | |
| parent | 828f611dfb7a1e08b8b842fb0a1fa45252ddcf67 (diff) | |
fixed montage drag selection bug - indexing was incorrect
Diffstat (limited to 'www/js/MontageCtrl.js')
| -rw-r--r-- | www/js/MontageCtrl.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 563d6746..5a844058 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -672,9 +672,26 @@ angular.module('zmApp.controllers') $scope.showPTZ = !$scope.showPTZ; }; - $scope.toggleSelectItem = function(ndx) + + function getIndex (mid) { + var ndx = 0; + for (var i=0; i< $scope.MontageMonitors.length; i++) + { + if ($scope.MontageMonitors[i].Monitor.Id == mid) + { + ndx = i; + break; + } + } + return ndx; + + } + $scope.toggleSelectItem = function(mid) + { + var ndx = getIndex(mid); + //console.log ("TOGGLE DETECTED AT INDEX:"+ndx+" NAME="+$scope.MontageMonitors[ndx].Monitor.Name); if ($scope.MontageMonitors[ndx].Monitor.selectStyle !== "undefined" && $scope.MontageMonitors[ndx].Monitor.selectStyle == "dragborder-selected") { $scope.MontageMonitors[ndx].Monitor.selectStyle = ""; |
