diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-12-21 10:24:05 -0500 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-12-21 10:24:05 -0500 |
| commit | a18aa84429258413b0e7adcd6c211f243ebefcf2 (patch) | |
| tree | fc2d7611e0c02562c63e7f836b1da3cf6e023620 /www/js/EventCtrl.js | |
| parent | 71860e6fda10e4772fad034ba036e1b66198a17c (diff) | |
#766 - wait for rotation to complete or width/height will be wrong
Diffstat (limited to 'www/js/EventCtrl.js')
| -rw-r--r-- | www/js/EventCtrl.js | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index b3741489..70883b29 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -2823,23 +2823,27 @@ angular.module('zmApp.controllers') function recomputeThumbSize() { // NVRDataModel.debug("EventCtrl: recompute thumbnails"); - for (var i = 0; i < $scope.events.length; i++) { - var tempMon = NVRDataModel.getMonitorObject($scope.events[i].Event.MonitorId); - if (tempMon != undefined) { - - var mw = parseInt(tempMon.Monitor.Width); - var mh = parseInt(tempMon.Monitor.Height); - var mo = parseInt(tempMon.Monitor.Orientation); - - var th = computeThumbnailSize(mw, mh, mo); - $scope.events[i].Event.thumbWidth = th.w; - $scope.events[i].Event.thumbHeight = th.h; - //console.log ("Setting to "+th.w+"*"+th.h); - + // remember, devHeight/devWidth upate 300ms after rotation + $timeout ( function () { + for (var i = 0; i < $scope.events.length; i++) { + var tempMon = NVRDataModel.getMonitorObject($scope.events[i].Event.MonitorId); + if (tempMon != undefined) { + + var mw = parseInt(tempMon.Monitor.Width); + var mh = parseInt(tempMon.Monitor.Height); + var mo = parseInt(tempMon.Monitor.Orientation); + + var th = computeThumbnailSize(mw, mh, mo); + $scope.events[i].Event.thumbWidth = th.w; + $scope.events[i].Event.thumbHeight = th.h; + //console.log ("Setting to "+th.w+"*"+th.h); + + } + + } - - - } + },500); + } |
