From 890396d763d613d76aee9a3d9af3850116a0ebf8 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 18 Aug 2016 09:16:28 -0500 Subject: #296 - make sure index of frame is real index Former-commit-id: 74cec5899c7a826420c0d46661abbb1abc439a2c --- www/js/EventCtrl.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'www/js/EventCtrl.js') diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index c827f98c..b6c99b76 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -427,12 +427,40 @@ angular.module('zmApp.controllers') var img; + //console.log ("HERE"); $scope.kFrame = $translate.instant ('kFrame'); $scope.kEvent = $translate.instant ('kEvent'); $scope.ndx = ndx; $scope.parray = parray; $scope.imode = imode; + // note ndx may be incorrect if we are looking + // at unique frames; + + // ZMDataModel.zmDebug("Hello"); + if ($scope.typeOfFrames == $translate.instant('kShowTimeDiffFrames')) + { + + var ic; + + for ( ic = 0; ic < $scope.parray.length; ic++) + { + if ($scope.parray[ic].frameid == fid) + break; + } + + + ZMDataModel.zmDebug ("Readjusting selected frame ID from:"+$scope.ndx+" to actual frame ID of:" + ic); + $scope.ndx = ic; + } + else + { + ZMDataModel.zmDebug ("No index adjustment necessary as we are using all frames"); + } + + + + // console.log ("Image Mode " + imode); // console.log ("parray : " + JSON.stringify(parray)); // console.log ("index: " + ndx); -- cgit v1.2.3