From 89969cf4d6dc308f68efc44d493f9a4a236a24cd Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Tue, 22 Dec 2015 11:21:18 -0500 Subject: #119 - fixes to pack in montage - still some odd header behavior but better than what exists now Former-commit-id: 869cab572aa43f457848bf0b4beab312cb17b6d3 --- www/css/style.css | 12 +++++++ www/js/DataModel.js | 16 +++++++-- www/js/MontageCtrl.js | 14 +++++++- www/templates/montage.html | 87 +++++++++++++++++++++++++++------------------- 4 files changed, 89 insertions(+), 40 deletions(-) diff --git a/www/css/style.css b/www/css/style.css index 163003a1..b45fd484 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -655,4 +655,16 @@ input[type=range]::-webkit-slider-thumb { -webkit-animation-delay: 1s; } +.montage_image +{ + margin-top:15px; + width: 100% !important; + height: auto !important; +} +.montage_image_full_screen +{ + margin-top:0px; + width: 100% !important; + height: auto !important; +} \ No newline at end of file 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 diff --git a/www/templates/montage.html b/www/templates/montage.html index d15e4350..9b4b6587 100644 --- a/www/templates/montage.html +++ b/www/templates/montage.html @@ -10,7 +10,7 @@ - + @@ -24,72 +24,86 @@
- + - + max="10" ng-change="sliderChanged(slider.monsize)"> +
- -
+
+ + + -
- - -
-
  - {{monitor.Monitor.Name}}  -
-
-
+
+
+ -
+
+   + {{monitor.Monitor.Name}}  +
+ + +
+
+ +
+ +
+ +
+ - - +
-
-
- +
+ +
+
-
- -
-
-
- -
+
+ +
-
-
- - - + + + + +
- No monitors to display. + + +

+ \ No newline at end of file -- cgit v1.2.3