diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-18 13:43:24 -0700 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-18 13:43:24 -0700 |
| commit | d4b661cd78db1b7cdc2b7174f8f254b4f5605a9c (patch) | |
| tree | bb9ecff8994681f3bd17e497c47f25e2206b573f /www/js/MontageHistoryCtrl.js | |
| parent | 6c3c2a2d3396b5ba85efcc47bb44ac59ff5cd325 (diff) | |
#353 - inital code (also requires ZM API patch) to support local and server timezones
Former-commit-id: bbee60cc64cb521c0f7d7fc75437a9f427c58b5a
Diffstat (limited to 'www/js/MontageHistoryCtrl.js')
| -rw-r--r-- | www/js/MontageHistoryCtrl.js | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js index 3ff57223..23f6bc4c 100644 --- a/www/js/MontageHistoryCtrl.js +++ b/www/js/MontageHistoryCtrl.js @@ -45,10 +45,10 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc }; function orientationChanged() { - NVRDataModel.debug("Detected orientation change, redoing packery resize"); - $timeout(function () { + // NVRDataModel.debug("Detected orientation change, redoing packery resize"); + /* $timeout(function () { pckry.onresize(); - }); + });*/ } //-------------------------------------- // pause/unpause nph-zms @@ -335,7 +335,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc function checkAllEvents() { //console.log("Timer:Events are checked...."); - if (pckry && !$scope.isDragabillyOn) pckry.shiftLayout(); + //if (pckry && !$scope.isDragabillyOn) pckry.shiftLayout(); for (var i = 0; i < $scope.MontageMonitors.length; i++) { // don't check for monitors that are not shown @@ -874,8 +874,19 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc var ld = NVRDataModel.getLogin(); var elem = angular.element(document.getElementById("mygrid")); + pckry = new Packery('.grid', { + itemSelector: '.grid-item', + percentPosition: true, + columnWidth: '.grid-sizer', + gutter: 0, + initLayout: true + + }); //console.log ("**** mygrid is " + JSON.stringify(elem)); imagesLoaded(elem).on('progress', function (instance, img) { + var result = img.isLoaded ? 'loaded' : 'broken'; + NVRDataModel.debug( '~~loaded image is ' + result + ' for ' + img.img.src ); + pckry.layout(); progressCalled = true; // if (layouttype) $timeout (function(){layout(pckry);},100); }); @@ -885,19 +896,12 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc NVRDataModel.debug("All images loaded"); $ionicLoading.hide(); - layouttype = true; - pckry = new Packery('.grid', { - itemSelector: '.grid-item', - percentPosition: true, - columnWidth: '.grid-sizer', - gutter: 0, - initLayout: layouttype - - }); - pckry.reloadItems(); + $scope.areImagesLoading = false; + + if (!progressCalled) { NVRDataModel.log("*** PROGRESS WAS NOT CALLED"); - + pckry.reloadItems(); } |
