diff options
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/DataModel.js | 16 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 14 |
2 files changed, 26 insertions, 4 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 497cc4b5..6d2bd45a 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -20,7 +20,7 @@ angular.module('zmApp.controllers') var zmAppVersion="unknown"; var isBackground = false; var monitorsLoaded = 0; - var montageSize = 3; + //var montageSize = 3; var monitors = []; var oldevents = []; @@ -57,8 +57,10 @@ angular.module('zmApp.controllers') 'montageOrder':'', 'montageHiddenOrder':'', 'montageArraySize':'0', + 'graphSize':200, 'minAlarmCount':'1', + 'montageSize':'10', }; @@ -211,6 +213,14 @@ angular.module('zmApp.controllers') loginData.minAlarmCount = '1'; } + + if (typeof loginData.montageSize == 'undefined') + { + zmDebug ("montageSize does not exist, setting to 18 (2 per col)"); + loginData.montageSize = 18; + } + + zmLog ("DataModel init recovered this loginData as " + JSON.stringify(loginData)); } else @@ -929,14 +939,14 @@ angular.module('zmApp.controllers') // //----------------------------------------------------------------------------- getMontageSize: function () { - return montageSize; + return loginData.montageSize; }, //----------------------------------------------------------------------------- // //----------------------------------------------------------------------------- setMontageSize: function (montage) { - montageSize = montage; + loginData.montageSize = montage; }, diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 69ff6129..ae9a9680 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -23,7 +23,10 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' $scope.scaleDirection = []; // 1 = increase -1 = decrease $scope.slider = {}; + + console.log ("************ GETTIGN SLIDER AS " + ZMDataModel.getMontageSize()); $scope.slider.monsize = ZMDataModel.getMontageSize(); + $scope.revMonSize = 11 - parseInt($scope.slider.monsize); // The difference between old and original is this: // old will have a copy of the last re-arranged monitor list @@ -110,6 +113,9 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' var timestamp = new Date().getUTCMilliseconds(); $scope.minimal = $stateParams.minimal; + $scope.zmMarginTop = $scope.minimal ? 0:15; + console.log ("********* MARGIN IS " + $scope.zmMarginTop); + $scope.isRefresh = $stateParams.isRefresh; var sizeInProgress = false; $scope.imageStyle = true; @@ -793,6 +799,8 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' //window.localStorage.setItem("montageArraySize", monsizestring); sizeInProgress = false; } + + //--------------------------------------------------------- // In full screen montage view, I call this function @@ -804,7 +812,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' $scope.slider.monsize = newSize; if ($scope.slider.monsize < "1") $scope.slider.monsize = "1"; - if ($scope.slider.monsize > "6") $scope.slider.monsize = "6"; + if ($scope.slider.monsize > "10") $scope.slider.monsize = "10"; processSliderChanged($scope.slider.monsize); }; @@ -818,7 +826,11 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' $scope.sliderChanged = function () { processSliderChanged($scope.slider.monsize); + + }; + + $scope.$on('$ionicView.afterEnter', function () { // This rand is really used to reload the monitor image in img-src so it is not cached |
