From d4b661cd78db1b7cdc2b7174f8f254b4f5605a9c Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Tue, 18 Oct 2016 13:43:24 -0700 Subject: #353 - inital code (also requires ZM API patch) to support local and server timezones Former-commit-id: bbee60cc64cb521c0f7d7fc75437a9f427c58b5a --- www/js/MontageCtrl.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'www/js/MontageCtrl.js') diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 6b3eedb8..735631af 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -199,6 +199,7 @@ angular.module('zmApp.controllers') $timeout(function () { pckry.getItemElements().forEach(function (itemElem) { + draggie = new Draggabilly(itemElem); draggie = new Draggabilly(itemElem); pckry.bindDraggabillyEvents(draggie); draggies.push(draggie); @@ -226,10 +227,8 @@ angular.module('zmApp.controllers') NVRDataModel.debug("All images loaded, doing image layout"); - $timeout(function () { - pckry.initShiftLayout(positions, 'data-item-id'); - //$scope.$digest(); - }, 0); + + } $timeout(function () { NVRDataModel.log("Force calling resize"); @@ -386,7 +385,7 @@ angular.module('zmApp.controllers') return; } - if (pckry && !$scope.isDragabillyOn) pckry.shiftLayout(); + //if (pckry && !$scope.isDragabillyOn) pckry.shiftLayout(); $rootScope.rand = Math.floor((Math.random() * 100000) + 1); // if you see the time move, montage should move @@ -844,11 +843,17 @@ angular.module('zmApp.controllers') function orientationChanged() { - NVRDataModel.debug("Detected orientation change, redoing packery resize"); + /* NVRDataModel.debug("Detected orientation change, redoing packery resize"); $timeout(function () { if (pckry) pckry.onresize(); - }, zm.packeryTimer); + }, zm.packeryTimer);*/ $ionicScrollDelegate.$getByHandle("montage-delegate").scrollTop(); + var positions = pckry.getShiftPositions('data-item-id'); + //console.log ("POSITIONS MAP " + JSON.stringify(positions)); + var ld = NVRDataModel.getLogin(); + ld.packeryPositions = JSON.stringify(positions); + //console.log ("Saving " + ld.packeryPositions); + NVRDataModel.setLogin(ld); } $scope.toggleSizeButtons = function () { -- cgit v1.2.3