summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2019-04-14 09:13:57 -0400
committerPliable Pixels <pliablepixels@gmail.com>2019-04-14 09:13:57 -0400
commitfe4dcc07af812244b85826a963234a85ff72a6ee (patch)
tree105f72f8ed45a47242bd10da71b177c234972583
parentab76b00e014a887268bece9c2cf427d68da01f5d (diff)
if all monitors is not saved in profiles, reset layout
-rw-r--r--www/js/MontageCtrl.js27
-rw-r--r--www/js/NVR.js9
-rw-r--r--www/templates/montage.html4
3 files changed, 31 insertions, 9 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index 5c84d097..b783a4b3 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -281,7 +281,13 @@ angular.module('zmApp.controllers')
} else {
//console.log ("POSITION STR IS " + positionsStr);
- positions = JSON.parse(positionsStr);
+ try {
+ positions = JSON.parse(positionsStr);
+ }
+ catch (e) {
+ NVR.debug ("error parsing profile");
+ }
+
NVR.log("found a packery layout");
layouttype = false;
@@ -1635,7 +1641,16 @@ angular.module('zmApp.controllers')
ld.packeryPositions = ld.packeryPositionsArray[mName];
ld.currentMontageProfile = mName;
$scope.currentProfileName = mName;
- //console.log ("NEW POS="+ld.packeryPositions);
+ console.log ("NEW POS="+ld.packeryPositions);
+
+ if (!ld.packeryPositions) {
+ ld.packeryPositions = [];
+ NVR.debug ("This profile doesn't seem to have been saved. Resetting it to defaults...");
+ $scope.resetSizes(true);
+
+ }
+
+
NVR.setLogin(ld);
@@ -1818,6 +1833,7 @@ angular.module('zmApp.controllers')
// if you are saving to default all monitor profile
// then I will undo any hidden monitors
if ($scope.data.montageName == $translate.instant('kMontageDefaultProfile')) {
+ NVR.debug ("All monitors is special, unhiding all");
for (var p = 0; p < getMonPos.length; p++) {
//console.log ("CHECK");
if (getMonPos[p].display != 'show') {
@@ -1829,7 +1845,7 @@ angular.module('zmApp.controllers')
var pos = JSON.stringify(getMonPos);
- //console.log ("SAVING POS = "+pos);
+ // console.log ("SAVING POS = "+pos);
ld.packeryPositionsArray[$scope.data.montageName] = pos;
NVR.debug("Saving " + $scope.data.montageName + " with:" + pos);
@@ -2327,9 +2343,12 @@ angular.module('zmApp.controllers')
});
- $scope.resetSizes = function () {
+ $scope.resetSizes = function (unhideAll) {
var somethingReset = false;
for (var i = 0; i < $scope.MontageMonitors.length; i++) {
+ if (unhideAll) {
+ $scope.MontageMonitors[i].Monitor.listDisplay = 'show';
+ }
if ($scope.isDragabillyOn) {
if ($scope.MontageMonitors[i].Monitor.selectStyle == "dragborder-selected") {
$scope.MontageMonitors[i].Monitor.gridScale = "50";
diff --git a/www/js/NVR.js b/www/js/NVR.js
index 0153bd79..87c76e80 100644
--- a/www/js/NVR.js
+++ b/www/js/NVR.js
@@ -508,8 +508,13 @@ angular.module('zmApp.controllers')
if (loginData.packeryPositions != '' && loginData.packeryPositions != undefined) {
// console.log("positions=" + loginData.packeryPositions);
-
- positions = JSON.parse(positionsStr);
+ try {
+ positions = JSON.parse(positionsStr);
+ }
+ catch (e) {
+ debug ("error parsing positions");
+ }
+
for (var m = 0; m < monitors.length; m++) {
var positionFound = false;
for (var p = 0; p < positions.length; p++) {
diff --git a/www/templates/montage.html b/www/templates/montage.html
index e48e973d..f505c135 100644
--- a/www/templates/montage.html
+++ b/www/templates/montage.html
@@ -154,9 +154,7 @@
<span ng-if="monitor.Monitor.isStamp && isDragabillyOn">
<i class="animated infinite flash ion-pin"></i>&nbsp;</span>
<i class="ion-ios-videocam"></i>&nbsp; {{monitor.Monitor.Name}}&nbsp;
- <i ng-if="$root.runMode!='lowbw'" ng-style="{'color':monitor.Monitor.alarmState}"
- class="ion-record"></i>&nbsp;
-
+
</figcaption>
</figure>