summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2020-09-06 15:42:53 -0400
committerPliable Pixels <pliablepixels@gmail.com>2020-09-06 15:42:53 -0400
commit0cfac6fd2a493675d5c9f242ac5cb5407a7cf70d (patch)
tree47e1a67fd57e08428f0e348f57c3d00a64e68536 /www/js
parent32e136f5ec7cbbf6838832513ca25a50244cfa74 (diff)
#963 comments
Diffstat (limited to 'www/js')
-rw-r--r--www/js/EventCtrl.js29
1 files changed, 24 insertions, 5 deletions
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);
}