From 0cfac6fd2a493675d5c9f242ac5cb5407a7cf70d Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sun, 6 Sep 2020 15:42:53 -0400 Subject: #963 comments --- www/js/EventCtrl.js | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'www') diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 8237f026..2ff4c35e 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -185,8 +185,9 @@ angular.module('zmApp.controllers') NVR.debug ("Cancelling page reload timer"); $interval.cancel(intervalReloadEvents); - NVR.debug("EventCtrl: Deregistering resize listener"); - window.removeEventListener("resize", recomputeThumbSize, false); + document.removeEventListener("pause", onPause, false); + + //NVR.debug("EventCtrl: Deregistering broadcast handles"); for (var i = 0; i < broadcastHandles.length; i++) { // broadcastHandles[i](); @@ -196,6 +197,21 @@ angular.module('zmApp.controllers') $scope.$on('$ionicView.beforeEnter', function () { + /* + It's a bleeding mess trying to get this working on + multiple devices and orientations with flex-box, primarily + because I'm not a CSS guru. + + Plus, collection-repeat offers significant performance benefits + and this requires fixed row sizes across all rows. + + The layout I am using: + a) If you are using large thumbs, it's a single column format + b) If you are using small thumbs, it's a two column format + + The max size of the image is in computeThumbnailSize() + */ + var ld = NVR.getLogin(); if (ld.eventViewThumbs != 'none') { if (ld.eventViewThumbsSize == 'large') { @@ -3001,8 +3017,8 @@ angular.module('zmApp.controllers') function computeThumbnailSize(mw, mh, mo) { + // if ZM is going to rotate the view, lets flip our dimensions if (mo != 0 && mo != 180) { - var tmp = mw; mw = mh; mh = tmp; @@ -3014,18 +3030,21 @@ angular.module('zmApp.controllers') if (ld.eventViewThumbsSize == 'large') { maxRowHeight = $scope.rowHeight - 170; if (landscape) { + // go till 90% of width in large landscape, but restricted to useable row height return calculateAspectRatioFit(mw, mh, 0.9* $rootScope.devWidth, maxRowHeight); } else { + // go till 80% of width in large portrait, but restricted to useable row height + return calculateAspectRatioFit(mw, mh, 0.8* $rootScope.devWidth, maxRowHeight); } } else { // small maxRowHeight = $scope.rowHeight - 150; - if (landscape) { + // go till 50% of width in small landscape, but restricted to useable row height return calculateAspectRatioFit(mw, mh, 0.5* $rootScope.devWidth, maxRowHeight); - } else { + // go till 30% of width in small portrait, but restricted to useable row height return calculateAspectRatioFit(mw, mh, 0.3* $rootScope.devWidth, maxRowHeight); } -- cgit v1.2.3