From 844368e1915f975eebf6c74b7f05a03c2f783877 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sat, 8 Oct 2016 10:18:42 -0400 Subject: #346 - display system time only if width >=700px. Also useful to check if montage refresh is happening Former-commit-id: d449a0a0f62e6c6b6c9226af3c4a3cba7ca32bb5 --- www/css/style.css | 12 ++++++++++++ www/js/MontageCtrl.js | 13 ++++++++++--- www/templates/montage.html | 3 +++ 3 files changed, 25 insertions(+), 3 deletions(-) (limited to 'www') diff --git a/www/css/style.css b/www/css/style.css index 3f625ef2..461d2750 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -920,3 +920,15 @@ body { color: #fff !important; } +@media (min-width:700px) { + .montage-time { + display:block !important; + line-height:250%; + } +} + +@media (max-width:699px) { + .montage-time { + display:none !important; + } +} diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 64ee0891..6910f148 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -1,7 +1,7 @@ // Controller for the montage view /* jshint -W041 */ /* jslint browser: true*/ -/* global cordova,StatusBar,angular,console,ionic,Packery, Draggabilly, imagesLoaded, ConnectSDK */ +/* global cordova,StatusBar,angular,console,ionic,Packery, Draggabilly, imagesLoaded, ConnectSDK, moment */ angular.module('zmApp.controllers') @@ -101,6 +101,7 @@ angular.module('zmApp.controllers') };*/ + // called by afterEnter to load Packery function initPackery() { @@ -368,12 +369,15 @@ angular.module('zmApp.controllers') function loadNotifications() { - if (!$scope.allImagesLoaded) { + if ($scope.areImagesLoading) { NVRDataModel.debug("skipping image refresh, packery is still loading"); return; } $rootScope.rand = Math.floor((Math.random() * 100000) + 1); + + // if you see the time move, montage should move + $scope.timeNow = moment().format(NVRDataModel.getTimeFormatSec()); //console.log ("Inside Montage timer..."); @@ -853,8 +857,11 @@ angular.module('zmApp.controllers') $scope.$on('$ionicView.afterEnter', function () { NVRDataModel.debug("Setting image mode to snapshot, will change to image when packery is all done"); - $scope.allImagesLoaded = false; + $scope.areImagesLoading = true; $scope.isDragabillyOn = false; + + $scope.timeNow = moment().format(NVRDataModel.getTimeFormatSec()); + $scope.gridScale = "grid-item-50"; $scope.LoginData = NVRDataModel.getLogin(); diff --git a/www/templates/montage.html b/www/templates/montage.html index 9e859e3e..ef7a4224 100644 --- a/www/templates/montage.html +++ b/www/templates/montage.html @@ -17,6 +17,7 @@ + {{timeNow}}  @@ -30,6 +31,8 @@ + + -- cgit v1.2.3