Skip to content

Commit

Permalink
#1067 handle case when user uses eye icon
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed Jul 3, 2021
1 parent c118bfc commit fdb2aea
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
21 changes: 18 additions & 3 deletions www/js/MontageCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -867,22 +867,32 @@ angular.module('zmApp.controllers')
for (var i=0; i < $scope.MontageMonitors.length; i++) {
var display= $scope.MontageMonitors[i].Monitor.listDisplay;
var id=$scope.MontageMonitors[i].Monitor.Id;
var found = false;
for (var j=0; j < beforeReorderPositions.length; j++) {
beforeReorderPositions[j].x = x;
beforeReorderPositions[j].y = 0;
beforeReorderPositions[j].size = '50';

x = (x==0)?0.5:0;
if (beforeReorderPositions[j].attr == id) {
beforeReorderPositions[j].display = display;

found = true;
break;
}
} // before reorder array
if (!found) {
beforeReorderPositions.push({'x':x, 'y':0, size:'50', 'display':display});
x = (x==0)?0.5:0;

}
} // montage monitors


ld.packeryPositions = JSON.stringify(beforeReorderPositions);
ld.currentMontageProfile='';
NVR.debug ('Updating positions:'+JSON.stringify(ld.packeryPositions));
//ld.currentMontageProfile = "__reorder__";
ld.currentMontageProfile = "__reorder__";
$scope.currentProfileName = $translate.instant('kMontage');
$timeout ( function () {
NVR.setLogin(ld)
Expand Down Expand Up @@ -1881,7 +1891,7 @@ angular.module('zmApp.controllers')
var ld = NVR.getLogin();
ld.packeryPositions = ld.packeryPositionsArray[mName];
ld.currentMontageProfile = mName;
$scope.currentProfileName = mName;
$scope.currentProfileName = mName || $translate.instant('kMontage');;
console.log ("NEW POS="+ld.packeryPositions);
var positionsStr = ld.packeryPositions;
var positions;
Expand Down Expand Up @@ -2179,7 +2189,7 @@ angular.module('zmApp.controllers')
NVR.debug("Saving " + $scope.data.montageName + " with:" + pos);
ld.currentMontageProfile = $scope.data.montageName;
NVR.setLogin(ld);
$scope.currentProfileName = $scope.data.montageName;
$scope.currentProfileName = $scope.data.montageName ||$translate.instant('kMontage');

if (unHidden) {
$rootScope.zmPopup = SecuredPopups.show('alert', {
Expand Down Expand Up @@ -2377,6 +2387,11 @@ angular.module('zmApp.controllers')

var ld = NVR.getLogin();
var layouttype = false;

if (ld.currentMontageProfile == '__reorder__') {
NVR.debug ('You manually messed with the profile, so skipping all matches');
return;
}

console.log ("matchMonitor positions:"+JSON.stringify(positions));
if (!mon) { mon = $scope.MontageMonitors;}
Expand Down
2 changes: 1 addition & 1 deletion www/templates/montage.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ion-view cache-view="false" hide-nav-bar="{{minimal}}" style="background-color:#444444">
<ion-nav-title>{{currentProfileName}} {{currentZMGroupName}}</ion-nav-title>
<ion-nav-title>{{currentProfileName=='__reorder__'? ('kMontage' | translate) :currentProfileName}} {{currentZMGroupName}}</ion-nav-title>
<ion-nav-buttons side="left">
<button id="montage-move-1" class="button button-icon button-clear ion-navicon" ng-click="openMenu()"></button>
&nbsp;
Expand Down

0 comments on commit fdb2aea

Please sign in to comment.