diff options
| author | pliablepixels <pliablepixels@gmail.com> | 2016-05-16 10:01:15 -0400 |
|---|---|---|
| committer | pliablepixels <pliablepixels@gmail.com> | 2016-05-16 10:01:15 -0400 |
| commit | cadf88096c24256d90db2b2c1567518187fcb125 (patch) | |
| tree | 6f6d565ed9f7e15b01834d304651b096a4f4dd24 /www/js/MontageCtrl.js | |
| parent | 374b1e58d415c5e2525a45654893516c798c5f44 (diff) | |
various updates to lazy to document why
Former-commit-id: 21224eb61a2b5e060b38cca3bfd5e0ccb85f95d7
Diffstat (limited to 'www/js/MontageCtrl.js')
| -rw-r--r-- | www/js/MontageCtrl.js | 92 |
1 files changed, 54 insertions, 38 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 2f80e57d..494e68a3 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -272,6 +272,12 @@ function initPackery() function loadAlarmStatus() { + + if (ZMDataModel.versionCompare($rootScope.apiVersion,"1.30")==-1) + { + + //return; + } for (var i=0; i < $scope.MontageMonitors.length; i++) { @@ -281,7 +287,7 @@ function initPackery() { continue; } - // getAlarmStatus($scope.MontageMonitors[i]); + getAlarmStatus($scope.MontageMonitors[i]); } @@ -397,7 +403,7 @@ function initPackery() }; - /* + $scope.toggleDelete = function (i) { @@ -407,7 +413,7 @@ function initPackery() $scope.copyMontage[i].Monitor.listDisplay = 'show'; ZMDataModel.zmDebug ("index " + i + " is now " + $scope.copyMontage[i].Monitor.listDisplay); - };*/ + }; $scope.hideUnhide = function() { @@ -772,29 +778,7 @@ function initPackery() // console.log("**VIEW ** Montage Ctrl Loaded"); }); - $scope.$on('$ionicView.enter', function () { - - //$scope.areImagesLoading = true; - var ld = ZMDataModel.getLogin(); - //console.log("Setting Awake to " + ZMDataModel.getKeepAwake()); - ZMDataModel.setAwake(ZMDataModel.getKeepAwake()); - - $interval.cancel(intervalHandleMontage); - $interval.cancel(intervalHandleAlarmStatus); - - intervalHandleMontage = $interval(function () { - loadNotifications(); - // console.log ("Refreshing Image..."); - }.bind(this), ld.refreshSec * 1000); - - intervalHandleAlarmStatus = $interval(function () { - loadAlarmStatus(); - // console.log ("Refreshing Image..."); - }.bind(this), 5000); - - - loadNotifications(); - }); + $scope.$on('$ionicView.leave', function () { // console.log("**VIEW ** Montage Ctrl Left, force removing modal"); @@ -802,14 +786,6 @@ function initPackery() }); - $scope.$on('$ionicView.afterEnter', function () { - console.log("**VIEW ** Montage Ctrl AFTER ENTER"); - window.addEventListener("resize", orientationChanged, false); - $timeout ( function () {initPackery(); },500); - document.addEventListener("pause", onPause, false); - document.addEventListener("resume", onResume, false); - - }); function orientationChanged() { ZMDataModel.zmDebug("Detected orientation change, redoing packery resize"); @@ -817,8 +793,23 @@ function initPackery() pckry.onresize(); }); } + +$scope.toggleSizeButtons = function() +{ + + $scope.showSizeButtons = !$scope.showSizeButtons; + ZMDataModel.zmDebug ("toggling size buttons:"+$scope.showSizeButtons); +}; -$scope.$on('$ionicView.enter', function () { +// minimal has to be beforeEnter or header won't hide +$scope.$on ('$ionicView.beforeEnter', function() { + $scope.minimal = $stateParams.minimal; + //console.log ("**************** MINIMAL ENTER " + $scope.minimal); + $scope.zmMarginTop = $scope.minimal ? 0 : 15; +}); + + +$scope.$on('$ionicView.afterEnter', function () { ZMDataModel.zmDebug("Setting image mode to snapshot, will change to image when packery is all done"); $scope.allImagesLoaded = false; $scope.isDragabillyOn = false; @@ -826,8 +817,8 @@ $scope.$on('$ionicView.enter', function () { $scope.gridScale = "grid-item-50"; $scope.LoginData = ZMDataModel.getLogin(); $scope.monLimit = $scope.LoginData.maxMontage; - $scope.minimal = $stateParams.minimal; - $scope.zmMarginTop = $scope.minimal ? 0 : 15; + $scope.showSizeButtons = false; + $scope.monitors = message; $scope.MontageMonitors = angular.copy(message); @@ -842,7 +833,28 @@ $scope.$on('$ionicView.enter', function () { $scope.isReorder = false; $ionicSideMenuDelegate.canDragContent($scope.minimal ? true : true); + + + //$scope.areImagesLoading = true; + var ld = ZMDataModel.getLogin(); + //console.log("Setting Awake to " + ZMDataModel.getKeepAwake()); + ZMDataModel.setAwake(ZMDataModel.getKeepAwake()); + $interval.cancel(intervalHandleMontage); + $interval.cancel(intervalHandleAlarmStatus); + + intervalHandleMontage = $interval(function () { + loadNotifications(); + // console.log ("Refreshing Image..."); + }.bind(this), ld.refreshSec * 1000); + + intervalHandleAlarmStatus = $interval(function () { + loadAlarmStatus(); + // console.log ("Refreshing Image..."); + }.bind(this), 5000); + + + loadNotifications(); if ($scope.MontageMonitors.length == 0) { $rootScope.zmPopup = $ionicPopup.alert({ @@ -899,7 +911,11 @@ $scope.$on('$ionicView.enter', function () { ZMDataModel.zmLog("MontageCtrl: Error returned Stream authentication construction. Retaining old value of: " + $rootScope.authSession); }); - + console.log("**VIEW ** Montage Ctrl AFTER ENTER"); + window.addEventListener("resize", orientationChanged, false); + $timeout ( function () {initPackery(); },500); + document.addEventListener("pause", onPause, false); + document.addEventListener("resume", onResume, false); }); |
